LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Marco for Picuture

Hi

Try saving as a webpage first and look in the folder if the pictures are OK for you.
If this is working you can use code to loop through the list and insert them in a sheet and save as a webpage.


--
Regards Ron de Bruin
http://www.rondebruin.nl


"William Benson" wrote in message ...
Ron,

I am sorry if I am wasting your time, I am greatful for you thinking about this and offering suggestions...


Basically I need to use Excel (or any other program which harnesses VBA) to harvest a collection of pictures from the Web, save
them to hard drive, so they can be pulled in as pictures at my convenience -- be it to an excel file, an access application, an
e-mail, whatever. I was thinking to save

http://www.blahblahblah/ThisPic.JPG files as JPEGs

and

http://www.blahblahblah/ThatPic.GIF files as GIFS

I felt I could probably copy each picture from the Web and store on my HD one by one, but if I have the list of URLs in excel I
thought it would be great if Excel could just grab the URLs and make pictures of each one, and save the picture (not the
worksheet) on my hard drive. Not much different than saving a ChartObject as a picture (I know it can be turned into HTML, but I
wanted a jpeg).

I really don't know if storing as a web page will work, I have seen the results of that, it is an icon that looks like an excel
file ... I don't think it is the same exact thing as a JPEG, and when I look at the file's contents in Notepad, it certainly does
have some code which I don't understand, but one thing I do recognize is 'SRC = ' and then it shows the source file's name. To me,
that should no longer be relevent in the final outcome, which I wanted to be just have a picture file (GIF or JPEG).


"Ron de Bruin" wrote in message ...

Hi William

You can insert them all in the same worsheet and save the file as a webpage.
It will create a htm file and a folder with all the pictures for you.
Is this a option for you ?


--
Regards Ron de Bruin
http://www.rondebruin.nl


"William Benson" wrote in message ...
Yes, just want to save the pictures ...

"Ron de Bruin" wrote in message ...
and I want to actually create a new file on my HD with this picture

This example will add a workbook with the picture ?
Do you want to save only the pictures ?


--
Regards Ron de Bruin
http://www.rondebruin.nl


"William Benson" wrote in message ...
I tried that, I guess I neede something a little different because I want the result to be the same type file the ImageURL was?
I am trying to use Excel as a mechanism to save the pictures which the imageURLs point to on my h.d. (depending on URL file, it
could be gif, could be jpg, etc) Thanks.


"Ron de Bruin" wrote in message ...
Hi William

Try this

With the list of urls in column A of "Sheet1"
in will insert the picture in a new workbook and save the file as Picture ?


Sub Add_Pictures_from_Website()
Dim wb As Workbook
Dim cell As Range
Dim a As Long
a = 0
For Each cell In Sheets("Sheet1").Columns("A").Cells.SpecialCells(x lCellTypeConstants)
If cell.Value Like "http://*" Then
a = a + 1
Set wb = Workbooks.Add(xlWBATWorksheet)

wb.Sheets(1).Shapes.AddPicture cell.Value, msoTrue, _
msoFalse, 100, 100, 100, 50
wb.SaveAs "Picture " & a & ".xls"
wb.Close False
End If
Next cell
End Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl


"William Benson" wrote in message ...
Good opportunity to jump in with a related problem Ron ... Can the below be expanded as follows: suppose had a list of image
URLs to loop through, and each of these I want to save the target to HD. Example:
http://us.a1.yimg.com/us.yimg.com/i/ww/beta/y3.gif

and I want to actually create a new file on my HD with this picture, can it be done? I tried using OLEObject and coundn't
get anywhere.

Thanks



"Ron de Bruin" wrote in message ...
Hi Daniel

You can use this to insert a picture and make it the same size as the cell

Sub test()
Dim YourPicture As Picture
With ActiveSheet.Range("D1")
Set YourPicture = .Parent.Pictures.Insert("C:\picture1.bmp")
YourPicture.Top = .Top
YourPicture.Width = .Width
YourPicture.Height = .Height
YourPicture.Left = .Left
YourPicture.Placement = xlMoveAndSize
End With
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Daniel R. Young" wrote in message
...
I am trying to create a macro in a cell that will insert a picture within the
cell specifically formatted to that cell so it will not be gigantic when
selected.

I started with this:
Private Sub Macro()

msoCommandBarButtonHyperlinkInsertPicture = (A83)

End Sub

Can someone help?

thank you,
Dan


















 
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
Excel: Use pic location string to call up picuture in cell? vloh28 Excel Discussion (Misc queries) 1 October 30th 07 12:42 AM
Marco Puzzled Excel Discussion (Misc queries) 3 July 30th 07 05:09 PM
Marco Help looper Excel Discussion (Misc queries) 2 May 12th 07 06:55 PM
I need some help with a Marco xgunda420x Excel Discussion (Misc queries) 2 August 2nd 05 01:43 PM
marco David Kuehl Excel Programming 4 September 18th 03 11:37 PM


All times are GMT +1. The time now is 11:04 AM.

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"