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

I am trying to import a picture off of the web, not data, into an Excel
cell.
When I do a New Web Query, while the table visually includes the image, the
image is not downloaded.
I think that is because the image is stored at a different URL.
When I enter the URL of the image into the cell, all I get is the URL
address.
If I double click on the cell, IE shows me the image.
So, I know the address is correct.

How do I tell Excel that I want it to download the image?

All assistance gratefully appreciated.
Gandalf

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Import picture into Excel cell

I usually right click the picture and trhen save to a local drive. Then
import the picture into excel using menu option Insert - Picture - From file.
I think if you want to emiminate a step you can use menu Insert - Picture -
Frimn file and put the url address into the picture address. The Picture
isn't sored at the URL of the webpage put in a folder associated with the URL
address.

"Gandalf the White" wrote:

I am trying to import a picture off of the web, not data, into an Excel
cell.
When I do a New Web Query, while the table visually includes the image, the
image is not downloaded.
I think that is because the image is stored at a different URL.
When I enter the URL of the image into the cell, all I get is the URL
address.
If I double click on the cell, IE shows me the image.
So, I know the address is correct.

How do I tell Excel that I want it to download the image?

All assistance gratefully appreciated.
Gandalf


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Import picture into Excel cell

Thanks Joel, but that is not my goal.

I also do not want to have the image double clicked into an IE window. Why
Excel has to make it this so difficult is beyond me. Unless, of course, I'm
missing something very simple which is very possible. I have been reading
some internet info about this.

It looks like this will require Excel's VB, to accomplish. In the Design
Mode, there is a Control involving Microsoft Web Browser, a Name Box with
WebBrowser1, and a function with =EMBED("Shell.Explorer.2",""). Excel's
Microsoft Visual Basic containing:

Private Sub Worksheet_Activate()
WebBrowser1.Navigate "www.worldcommunitygrid.org/images/pb/faah_0.jpg"
End Sub

This all I have been able to uncover across many web pages, so far, but it
will not work for me. Surprise, surprise. I am not into VB. I'm sure
someone out there in Internet land is rofl. I feel I am a tweak away from
making this work, but what that tweak is I have no idea. You see, I have
been doing my homework, so to speak. It's just that, in the web info, I
think I am assumed to know something I don't.

NOTE: I've discovered all this since I initially posted this thread. Since
this is all within the Excel program application, I have not address this to
the VB newsgroup. If I should, please let me know.

All assistance gratefully appreciated.
Gandalf


"Joel" wrote in message
...
I usually right click the picture and trhen save to a local drive. Then
import the picture into excel using menu option Insert - Picture - From
file.
I think if you want to emiminate a step you can use menu Insert -
Picture -
Frimn file and put the url address into the picture address. The Picture
isn't sored at the URL of the webpage put in a folder associated with the
URL
address.

"Gandalf the White" wrote:

I am trying to import a picture off of the web, not data, into an Excel
cell.
When I do a New Web Query, while the table visually includes the image,
the
image is not downloaded.
I think that is because the image is stored at a different URL.
When I enter the URL of the image into the cell, all I get is the URL
address.
If I double click on the cell, IE shows me the image.
So, I know the address is correct.

How do I tell Excel that I want it to download the image?

All assistance gratefully appreciated.
Gandalf



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Import picture into Excel cell

I hate excel also because it makes it so difficult to do some obvious simple
taskw. I'vew been doing a lot of programming in excel VBA using the internet
explorer. I put a sample of my code below. I don't know if there is a way
with the internet explorer to copy a picture and place it on the worksheet.
I still think the way is to use the Insert Picture.

You can use this line to import a picture fro a file

ActiveSheet.Pictures.Insert( _
set MyPicture = "C:\Documents and Settings\Joel\" & _
"My Documents\MyPictures\lincoln.bmp")

Here is a JPG file I added to my worksheet from microsoft.com using the same
command

Sub AddPicture()

MyPicture = "ftp://ftp.microsoft.com/Products/Windows/" & _
"Windowsce/007LOGO.JPG"

Set MyPict = ActiveSheet.Pictures.Insert(MyPicture)

End Sub

Here is an example of using internet explorer from Excel VBA

Sub GetZipCodes()


ZIPCODE = InputBox("Enter 5 digit zipcode : ")

Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

URL = "http://zip4.usps.com/zip4/citytown_zip.jsp"

'get web page
IE.Navigate2 URL
Do While IE.readyState < 4
DoEvents
Loop

Do While IE.busy = True
DoEvents
Loop
Set Form = IE.document.getElementsByTagname("Form")

Set zip5 = IE.document.getElementById("zip5")
zip5.Value = ZIPCODE


Set ZipCodebutton = Form(0).onsubmit

Form(0).submit
Do While IE.busy = True
DoEvents
Loop

Set Table = IE.document.getElementsByTagname("Table")
Location = Table(0).Rows(2).innertext
IE.Quit
MsgBox ("Zip code = " & ZIPCODE & " City/State = " & Location)


End Sub



"Joel" wrote:

I usually right click the picture and trhen save to a local drive. Then
import the picture into excel using menu option Insert - Picture - From file.
I think if you want to emiminate a step you can use menu Insert - Picture -
Frimn file and put the url address into the picture address. The Picture
isn't sored at the URL of the webpage put in a folder associated with the URL
address.

"Gandalf the White" wrote:

I am trying to import a picture off of the web, not data, into an Excel
cell.
When I do a New Web Query, while the table visually includes the image, the
image is not downloaded.
I think that is because the image is stored at a different URL.
When I enter the URL of the image into the cell, all I get is the URL
address.
If I double click on the cell, IE shows me the image.
So, I know the address is correct.

How do I tell Excel that I want it to download the image?

All assistance gratefully appreciated.
Gandalf


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Import picture into Excel cell

Joel, again thanks for the reply, but again I'm not into VB.
Your code is like Greek to me.
Multiple lines of Greek is still Greek. :)

The code from my post seems to create a small IE window inside the cell.
It's just not bringing in the image.
Can someone show me how to make "my" code work?

All assistance gratefully appreciated.
Gandalf



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Import picture into Excel cell

what you are doing is wrong

Private Sub Worksheet_Activate()
WebBrowser1.Navigate "www.worldcommunitygrid.org/images/pb/faah_0.jpg"
End Sub


1) The worksheet Activate will load the picture everytime you change the
worksheet. You only need to load the picture once.

2) You don't need to use a web browser function. Just inserting the picture
will work. Here is the code I think you should use

Sub GetPicture()

PictureURL = "http://www.worldcommunitygrid.org/images/pb/faah_0.jpg"

Set MyPict = ActiveSheet.Pictures.Insert(PictureURL)

End Sub

I tested this code and it work just like it should.

"Gandalf the White" wrote:

Joel, again thanks for the reply, but again I'm not into VB.
Your code is like Greek to me.
Multiple lines of Greek is still Greek. :)

The code from my post seems to create a small IE window inside the cell.
It's just not bringing in the image.
Can someone show me how to make "my" code work?

All assistance gratefully appreciated.
Gandalf


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Import picture into Excel cell

Sorry for the double post. My ignorance.

This is what I needed. Great.
Thanks Joel.



"Joel" wrote in message
...
what you are doing is wrong

Private Sub Worksheet_Activate()
WebBrowser1.Navigate "www.worldcommunitygrid.org/images/pb/faah_0.jpg"
End Sub


1) The worksheet Activate will load the picture everytime you change the
worksheet. You only need to load the picture once.

2) You don't need to use a web browser function. Just inserting the
picture
will work. Here is the code I think you should use

Sub GetPicture()

PictureURL = "http://www.worldcommunitygrid.org/images/pb/faah_0.jpg"

Set MyPict = ActiveSheet.Pictures.Insert(PictureURL)

End Sub

I tested this code and it work just like it should.

"Gandalf the White" wrote:

Joel, again thanks for the reply, but again I'm not into VB.
Your code is like Greek to me.
Multiple lines of Greek is still Greek. :)

The code from my post seems to create a small IE window inside the cell.
It's just not bringing in the image.
Can someone show me how to make "my" code work?

All assistance gratefully appreciated.
Gandalf



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
Connect a number to a picture bank and import that picture to exce Dennis Hedo Excel Discussion (Misc queries) 1 March 22nd 10 02:17 PM
import a picture into a pre defined range of cells - excel 2003 Tog Excel Discussion (Misc queries) 1 February 16th 10 12:24 AM
How can I Import picture contents into Excell cell array numbers? CLR Excel Worksheet Functions 0 November 29th 06 06:38 PM
How can I Import picture contents into Excell cell array numbers? Hard Nut Excel Worksheet Functions 0 November 29th 06 03:24 PM
how do i import a picture or drawing into an excel spreadsheet? ucastores Excel Discussion (Misc queries) 6 December 1st 04 05:40 AM


All times are GMT +1. The time now is 03:40 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"