Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do export jpg into excel file

Posted on 2010-08-29
2
Medium Priority
?
493 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 2000 total points
ID: 33556210
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Suggested Courses

886 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