Solved

How do export jpg into excel file

Posted on 2010-08-29
2
478 Views
Last Modified: 2013-12-09
I use vb.net 2008 and firebird DB.

I use database to refer to a jpg file. something like C:\picture\1.jpg and now i need to export it to excel file by include the 1.jpg inside excel file.
0
Comment
Question by:aarontham
  • 2
2 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 33556209
You can try the following
Dim xlSheet1 As Excel.Worksheet
Dim xlRange As Excel.Range
Try
Dim ms As New System.IO.MemoryStream
Dim oIMage As Image = Image.FromFile("c:\Integrallogo.bmp")
oIMage.Save(ms, oIMage.RawFormat)
Dim arrImage() As Byte = ms.GetBuffer
Dim integralLogo As Bitmap = CType(Image.FromStream(ms), Bitmap)
Clipboard.SetDataObject(integralLogo)
xlRange = xlSheet1.Range(xlSheet1.Cells(1, 1), xlSheet1.Cells(1, 1))
xlRange.Select()
xlSheet1.Paste()
Catch ex As Exception
End Try

Open in new window

0
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
ID: 33556210
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help with adding DLL file in Windows project 20 32
Mongo DB 18 46
Connecting to multiple databases to create a Dashboard 5 26
Calculate number of nights between two dates 5 28
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Read about achieving the basic levels of HRIS security in the workplace.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question