Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Import images into excel cell from database

I have a 2 part question if anybody is inclined to help me out =)

1. Is it possible to import images into an excel spreadsheet from a
database such as mysql? And could you point me to any links?

2. For now, I'm using the below macro:
Sub PictureMe()
spath = "http://127.0.0.1/"
i = 13
bcontinue = True


While bcontinue
sFilename = Worksheets(1).Cells(i, 13).Value 'get filename from cell
e.g. image1.jpg
sExt = ".jpg"

If sFilename = "" Then
bcontinue = False
Else
Cells(i, 6).Select
ActiveSheet.Pictures.Insert(spath & sFilename & sExt).Select
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = 142
Selection.ShapeRange.Width = 155
i = i + 1
End If
Wend
End Sub

It's pulling from a local webserver fine. It's just that it will stop
if the picture name doesn't exist in the htdocs/ directory. Ideally
I'd love it to do some type of error checking. Such as highlighting
cells where the filename doesn't exist before inserting any pictures.

Any help would be most appreciated.

Thanks!

--Jerry

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import from Excel into database using jet in VB.net Andy HP Excel Discussion (Misc queries) 0 February 7th 08 08:33 AM
database query not showing foxpro database How I import data mangat New Users to Excel 1 June 24th 07 03:31 PM
Cell Format import from Database SpaceCoorDinator Excel Discussion (Misc queries) 1 May 7th 07 05:41 PM
Import And Resize Images 2eXtreme Excel Discussion (Misc queries) 6 February 5th 06 03:47 PM
Import images gav meredith Excel Programming 0 April 8th 04 01:10 AM


All times are GMT +1. The time now is 11:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"