Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Refreshing Linked Picture

Hi,

I have inserted a picture using VBA with

Shapes.AddPicture() and set the linked to Shapes.AddPicture and set the
linked parameter to msoTrue.

This causes the image to refresh whenever the workbook is opened.

1) How can I FORCE a refresh??

2) BTW, is there any way to insert a linked picture through the Excel GUI?

TIA
Rich


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Refreshing Linked Picture

Hi Rich: Don't know how to refresh a link when it is in a Shape as the
container, but it can be done when it is in an OLEObject instead. To add it
you would use:
ActiveSheet.OLEObjects.Add Filename:="FilePath", Link:= True,
DisplayAsIcon:=False ' substitute your picture's file path for FilePath
Then to update the link it is just
ActiveSheet.OLDObjects(n).Update ' substitute the proper index for n

And to insert it through Excel's GUI, it is Insert... Object... Create From
File, then Browse for the file and check off the "link to file" checkbox

"Rich" wrote:

Hi,

I have inserted a picture using VBA with

Shapes.AddPicture() and set the linked to Shapes.AddPicture and set the
linked parameter to msoTrue.

This causes the image to refresh whenever the workbook is opened.

1) How can I FORCE a refresh??

2) BTW, is there any way to insert a linked picture through the Excel GUI?

TIA
Rich



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Refreshing Linked Picture

Thanks,

I gave it a go, but the image appears as a box with what text of what
appears to be a temp filename in it (eg A7563570.gif) rather than the actual
image.

I remember the same when I was first inserting through the GUI as you
suggest.

Any ideas??

Thanks

"K Dales" wrote in message
...
Hi Rich: Don't know how to refresh a link when it is in a Shape as the
container, but it can be done when it is in an OLEObject instead. To add

it
you would use:
ActiveSheet.OLEObjects.Add Filename:="FilePath", Link:= True,
DisplayAsIcon:=False ' substitute your picture's file path for FilePath
Then to update the link it is just
ActiveSheet.OLDObjects(n).Update ' substitute the proper index for n

And to insert it through Excel's GUI, it is Insert... Object... Create

From
File, then Browse for the file and check off the "link to file" checkbox

"Rich" wrote:

Hi,

I have inserted a picture using VBA with

Shapes.AddPicture() and set the linked to Shapes.AddPicture and set the
linked parameter to msoTrue.

This causes the image to refresh whenever the workbook is opened.

1) How can I FORCE a refresh??

2) BTW, is there any way to insert a linked picture through the Excel

GUI?

TIA
Rich





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Refreshing Linked Picture

Excel is using your file associations to decide what kind of object it is,
and unfortunately does not handle .gifs too well there (it would depend on
your setup, but it makes it into a Photo Editor object on my machine, and I
get the blank box). You can try setting the file association to give you
different applications to use as the container object, but I can't say what
you might have that will work or how Excel will handle each app (can it
display the picture, or will it use the blank box?).

Does that picture need to be a .gif? It should work easily if you can
convert it (e.g. open it in Paint then Save As...) to a .bmp or .jpg, since
Excel does not seem to have the same trouble recognizing these.

"Rich" wrote:

Thanks,

I gave it a go, but the image appears as a box with what text of what
appears to be a temp filename in it (eg A7563570.gif) rather than the actual
image.

I remember the same when I was first inserting through the GUI as you
suggest.

Any ideas??

Thanks

"K Dales" wrote in message
...
Hi Rich: Don't know how to refresh a link when it is in a Shape as the
container, but it can be done when it is in an OLEObject instead. To add

it
you would use:
ActiveSheet.OLEObjects.Add Filename:="FilePath", Link:= True,
DisplayAsIcon:=False ' substitute your picture's file path for FilePath
Then to update the link it is just
ActiveSheet.OLDObjects(n).Update ' substitute the proper index for n

And to insert it through Excel's GUI, it is Insert... Object... Create

From
File, then Browse for the file and check off the "link to file" checkbox

"Rich" wrote:

Hi,

I have inserted a picture using VBA with

Shapes.AddPicture() and set the linked to Shapes.AddPicture and set the
linked parameter to msoTrue.

This causes the image to refresh whenever the workbook is opened.

1) How can I FORCE a refresh??

2) BTW, is there any way to insert a linked picture through the Excel

GUI?

TIA
Rich






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Refreshing Linked Picture

Hmmm, sounds grave, want to be able to distribute the workbook, so playing
around with file types not an option.

It rips a graphic off my website, and I think that is the problem, because
the same behaviour is displayed for jpeg.

Bitmap displays but does not update properly.

I might try deleting and reinserting the linked image on a timer (or just
pull that function!)

Thanks for your help.

Rich



"K Dales" wrote in message
...
Excel is using your file associations to decide what kind of object it is,
and unfortunately does not handle .gifs too well there (it would depend on
your setup, but it makes it into a Photo Editor object on my machine, and

I
get the blank box). You can try setting the file association to give you
different applications to use as the container object, but I can't say

what
you might have that will work or how Excel will handle each app (can it
display the picture, or will it use the blank box?).

Does that picture need to be a .gif? It should work easily if you can
convert it (e.g. open it in Paint then Save As...) to a .bmp or .jpg,

since
Excel does not seem to have the same trouble recognizing these.

"Rich" wrote:

Thanks,

I gave it a go, but the image appears as a box with what text of what
appears to be a temp filename in it (eg A7563570.gif) rather than the

actual
image.

I remember the same when I was first inserting through the GUI as you
suggest.

Any ideas??

Thanks

"K Dales" wrote in message
...
Hi Rich: Don't know how to refresh a link when it is in a Shape as

the
container, but it can be done when it is in an OLEObject instead. To

add
it
you would use:
ActiveSheet.OLEObjects.Add Filename:="FilePath", Link:= True,
DisplayAsIcon:=False ' substitute your picture's file path for

FilePath
Then to update the link it is just
ActiveSheet.OLDObjects(n).Update ' substitute the proper index for

n

And to insert it through Excel's GUI, it is Insert... Object... Create

From
File, then Browse for the file and check off the "link to file"

checkbox

"Rich" wrote:

Hi,

I have inserted a picture using VBA with

Shapes.AddPicture() and set the linked to Shapes.AddPicture and set

the
linked parameter to msoTrue.

This causes the image to refresh whenever the workbook is opened.

1) How can I FORCE a refresh??

2) BTW, is there any way to insert a linked picture through the

Excel
GUI?

TIA
Rich










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
Linked cells not refreshing Steph C Excel Worksheet Functions 2 September 18th 09 07:35 PM
refreshing data from a linked *.dbf database file without opening it. Ahrder Links and Linking in Excel 0 February 27th 09 04:12 AM
saving and refreshing workbook linked to a SQL database Texas Tonie[_2_] Excel Discussion (Misc queries) 0 November 9th 07 11:03 PM
Refreshing a linked Access Database Rob Excel Discussion (Misc queries) 0 October 17th 07 12:40 AM
refreshing linked workbooks mike47338 Excel Worksheet Functions 1 May 31st 06 04:18 PM


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