Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Limitation on .Pictures.Insert?

Hello. I fear I may be running into a limitation of VBA, but figured
I'd check with the gurus to see if I'm doing anything silly.

When I manually insert a photo (Insert | Picture | <filename) in
Excel (Office 12), it allows me to use an URL for my filename (eg.
http://www.seattlesmiths.com/photos/codi1.jpg). However if I try to
use an URL in my macro (ie ActiveSheet.Pictures.Insert("http://
www.seattlesmiths.com/photos/codi1.jpg")) it gives me the following
error:

"Unable to get the insert property of the Pictures class"

If I use a local photo, the call works correctly. Any ideas on how to
programatically insert a photo using an URL rather than a local file?

Thanks!
Dave
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Limitation on .Pictures.Insert?

I don't have 2007, but have you tried to record a macro while you do the
insert manually? This may get you the exact syntax required for an external
link.

Mike F
"Dave" wrote in message
...
Hello. I fear I may be running into a limitation of VBA, but figured
I'd check with the gurus to see if I'm doing anything silly.

When I manually insert a photo (Insert | Picture | <filename) in
Excel (Office 12), it allows me to use an URL for my filename (eg.
http://www.seattlesmiths.com/photos/codi1.jpg). However if I try to
use an URL in my macro (ie ActiveSheet.Pictures.Insert("http://
www.seattlesmiths.com/photos/codi1.jpg")) it gives me the following
error:

"Unable to get the insert property of the Pictures class"

If I use a local photo, the call works correctly. Any ideas on how to
programatically insert a photo using an URL rather than a local file?

Thanks!
Dave



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Limitation on .Pictures.Insert?

I think the solution is very simple. Remove "http:" from the file name.
http is the name of a transfer protocol (hyper-text-transfer-protocol).
Excel want a file name which simply starts with the two slashes.

"Dave" wrote:

Hello. I fear I may be running into a limitation of VBA, but figured
I'd check with the gurus to see if I'm doing anything silly.

When I manually insert a photo (Insert | Picture | <filename) in
Excel (Office 12), it allows me to use an URL for my filename (eg.
http://www.seattlesmiths.com/photos/codi1.jpg). However if I try to
use an URL in my macro (ie ActiveSheet.Pictures.Insert("http://
www.seattlesmiths.com/photos/codi1.jpg")) it gives me the following
error:

"Unable to get the insert property of the Pictures class"

If I use a local photo, the call works correctly. Any ideas on how to
programatically insert a photo using an URL rather than a local file?

Thanks!
Dave

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Limitation on .Pictures.Insert?

On Mar 21, 3:46*am, "Mike Fogleman" wrote:
I don't have 2007, but have you tried to record a macro while you do the
insert manually? This may get you the exact syntax required for an external
link.

Mike F"Dave" wrote in message

...



Hello. *I fear I may be running into a limitation of VBA, but figured
I'd check with the gurus to see if I'm doing anything silly.


When I manually insert a photo (Insert | Picture | <filename) in
Excel (Office 12), it allows me to use an URL for my filename (eg.
http://www.seattlesmiths.com/photos/codi1.jpg). *However if I try to
use an URL in my macro (ie ActiveSheet.Pictures.Insert("http://
www.seattlesmiths.com/photos/codi1.jpg")) it gives me the following
error:


"Unable to get the insert property of the Pictures class"


If I use a local photo, the call works correctly. *Any ideas on how to
programatically insert a photo using an URL rather than a local file?


Thanks!
Dave- Hide quoted text -


- Show quoted text -

thanks for your response.

Strangely, when I use the macro recorder it just creates an empty
macro. this occurs both for inserting a local picture, and when I use
the URL.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Limitation on .Pictures.Insert?

On Mar 21, 3:48*am, Joel wrote:
I think the solution is very simple. *Remove "http:" from the file name. *
http is the name of a transfer protocol (hyper-text-transfer-protocol). *
Excel want a file name which simply starts with the two slashes.



"Dave" wrote:
Hello. *I fear I may be running into a limitation of VBA, but figured
I'd check with the gurus to see if I'm doing anything silly.


When I manually insert a photo (Insert | Picture | <filename) in
Excel (Office 12), it allows me to use an URL for my filename (eg.
http://www.seattlesmiths.com/photos/codi1.jpg). *However if I try to
use an URL in my macro (ie ActiveSheet.Pictures.Insert("http://
www.seattlesmiths.com/photos/codi1.jpg")) it gives me the following
error:


"Unable to get the insert property of the Pictures class"


If I use a local photo, the call works correctly. *Any ideas on how to
programatically insert a photo using an URL rather than a local file?


Thanks!
Dave- Hide quoted text -


- Show quoted text -


Hmmm. I fine idea, but I'm afraid it doesn't work. When running the
macro without the http: it pauses for a minute or so, then errors out
with "Insert method of Pictures class failed".


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Limitation on .Pictures.Insert?

I have heard 2007 won't record macros for drawing objects, it must apply to
pictures also. Anyway, my version does record and the code is exactly what
you tried to use and got the error. Of course 2000 & 2003 gives me a picture
of a black dog lying in the yard.
I would assume this is some security issue that 2007 has addressed
concerning web-based pictures being freely written to Excel. It may be as
simple as allowing some security option in Excel.
Good Luck,
Mike F
"Dave" wrote in message
...
On Mar 21, 3:46 am, "Mike Fogleman" wrote:
I don't have 2007, but have you tried to record a macro while you do the
insert manually? This may get you the exact syntax required for an
external
link.

Mike F"Dave" wrote in message

...



Hello. I fear I may be running into a limitation of VBA, but figured
I'd check with the gurus to see if I'm doing anything silly.


When I manually insert a photo (Insert | Picture | <filename) in
Excel (Office 12), it allows me to use an URL for my filename (eg.
http://www.seattlesmiths.com/photos/codi1.jpg). However if I try to
use an URL in my macro (ie ActiveSheet.Pictures.Insert("http://
www.seattlesmiths.com/photos/codi1.jpg")) it gives me the following
error:


"Unable to get the insert property of the Pictures class"


If I use a local photo, the call works correctly. Any ideas on how to
programatically insert a photo using an URL rather than a local file?


Thanks!
Dave- Hide quoted text -


- Show quoted text -

thanks for your response.

Strangely, when I use the macro recorder it just creates an empty
macro. this occurs both for inserting a local picture, and when I use
the URL.


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Limitation on .Pictures.Insert?

Mike:

That is correct. When you try to record a macro for inserting an image, the
macro is blank.

I haven't found a way to insert an image from URL and only link to it. I
have been using AddShape and UserPicture, but there is no option to link only.

Ironically, it is possible to insert an image from a URL into a spreadsheet,
and even do it as either a link only, embedded only, or linked and embedded.
So it must be possible. If only we could reveal the method used by Excel 2007.

Any suggestions would be hugely appreciated.

Thanks.
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
Can't insert pictures laurie New Users to Excel 2 April 5th 23 01:21 PM
Insert pictures AZU Excel Discussion (Misc queries) 5 March 6th 09 05:28 PM
insert pictures [email protected] Excel Programming 5 October 29th 07 10:23 AM
Insert pictures dc Excel Programming 2 June 5th 07 06:43 AM
Insert pictures TheRook Excel Programming 4 August 11th 06 02:58 PM


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