Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Capturing and saving image from a url link-CPEARSON

I am still trying to capture the jpegs on the image server from my supplier.
The macro you gave me works to download only the first url in my coumn. It
save one jpeg to the test file but doesn't insert the name of the new jpeg in
the next cell in the spreadsheet. IT does retreive one image,it will save
another image if icahng the value in () at the hyperlink equation and only if
its in the range. Any further help you can give me would be great.
Here is the macro I am using.

Private Declare Function URLDownloadToFile _
Lib "urlmon" Alias "URLDownloadToFileA" ( _
ByVal pCaller As Long, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long

Sub AAA()
Dim FolderName As String
Dim URL As String
Dim FName As String

FolderName = "C:\Test" '<<< CHANGE
URL = Range("D2:D90").Hyperlinks(8).Address '<<< CHANGE
FName = FolderName & "\" & Mid(URL, InStrRev(URL, "/") + 1)
URLDownloadToFile 0&, URL, FName, 0&, 0&

End Sub
--
sdatools
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default Capturing and saving image from a url link-CPEARSON

Sean,

Try looping, along the lines of


For i = 1 to Range("D2:D90").Hyperlinks.Count
URL = Range("D2:D90").Hyperlinks(i).Address
FName = FolderName & "\" & Mid(URL, InStrRev(URL, "/") + 1)
URLDownloadToFile 0&, URL, FName, 0&, 0&
Next i


HTH,
Bernie
MS Excel MVP


"samboy" wrote in message
...
I am still trying to capture the jpegs on the image server from my supplier.
The macro you gave me works to download only the first url in my coumn. It
save one jpeg to the test file but doesn't insert the name of the new jpeg in
the next cell in the spreadsheet. IT does retreive one image,it will save
another image if icahng the value in () at the hyperlink equation and only if
its in the range. Any further help you can give me would be great.
Here is the macro I am using.

Private Declare Function URLDownloadToFile _
Lib "urlmon" Alias "URLDownloadToFileA" ( _
ByVal pCaller As Long, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long

Sub AAA()
Dim FolderName As String
Dim URL As String
Dim FName As String

FolderName = "C:\Test" '<<< CHANGE
URL = Range("D2:D90").Hyperlinks(8).Address '<<< CHANGE
FName = FolderName & "\" & Mid(URL, InStrRev(URL, "/") + 1)
URLDownloadToFile 0&, URL, FName, 0&, 0&

End Sub
--
sdatools



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
Saving clipboard image as BMP through VBA in Excel Elliot Excel Discussion (Misc queries) 0 September 17th 08 03:22 AM
Link to an image Kalevi New Users to Excel 1 September 27th 07 02:39 PM
PASTE LINK option not available when I select PASTE SPECIAL to link an image in Excel to a Word document. tln Links and Linking in Excel 0 April 22nd 07 04:28 PM
image link Kaby Excel Discussion (Misc queries) 0 August 2nd 06 10:41 PM
How to link an Image to a cell value hhalle Excel Worksheet Functions 2 January 16th 06 06:16 AM


All times are GMT +1. The time now is 04:06 PM.

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

About Us

"It's about Microsoft Excel"