Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Image File Path for Linked Pictures
I am trying to return the full source path of image files for linked images
in an Excel spreadsheet (msoLinkedPicture). The following code does not work, but it demonstrates what I am trying to do. Dim oShape As Shape For Each oShape In ActiveSheet.Shapes If oShape.Type = msoLinkedPicture Then Debug.Print oShape.LinkFormat.SourceFullName End If Next Does anyone happen to know how to return a linked picture's source name? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Image File Path for Linked Pictures
I got the name a little different than you were trying. I added awatch to
oshape and then open it up and started searching for the path. Sub xyz() Dim oShape As Shape For Each oShape In ActiveSheet.Shapes 'If oShape.Type = msoLinkedPicture Then abc = oShape.OLEFormat.Object.SourceName Debug.Print oShape.OLEFormat.Object.SourceName 'End If Next End Sub "Lazzaroni" wrote: I am trying to return the full source path of image files for linked images in an Excel spreadsheet (msoLinkedPicture). The following code does not work, but it demonstrates what I am trying to do. Dim oShape As Shape For Each oShape In ActiveSheet.Shapes If oShape.Type = msoLinkedPicture Then Debug.Print oShape.LinkFormat.SourceFullName End If Next Does anyone happen to know how to return a linked picture's source name? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Image File Path for Linked Pictures
How did you create your linked picture ?
NickHK "Lazzaroni" wrote in message ... I am trying to return the full source path of image files for linked images in an Excel spreadsheet (msoLinkedPicture). The following code does not work, but it demonstrates what I am trying to do. Dim oShape As Shape For Each oShape In ActiveSheet.Shapes If oShape.Type = msoLinkedPicture Then Debug.Print oShape.LinkFormat.SourceFullName End If Next Does anyone happen to know how to return a linked picture's source name? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Image File Path for Linked Pictures
Nick:
Good question. I wonder if my problems have something to do with the way I am creating the image object. I use the following code: Dim oPicture As Object Dim sFilename As String Set oPicture = ActiveSheet.Shapes.AddPicture(sFilename, msoTrue, msoFalse, 10, 10, 100, 100) The images work fine and are definitely linked. If I delete the external file, the image breaks when I restart Excel. ActiveSheet.Shapes("Picture 1").Type returns msoLinkedPicture. I tried finding an object to return the path of the linked image file, but the best I could do was: ActiveSheet.Shapes("Picture 1").LinkFormat.SourceName But that just returns the following error: "Object doesn't support this property or method." Joel's suggestion didn't work for me either. Thank you for your help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formula too long - new file path is shorter than old file path - Excel 2003 | Excel Worksheet Functions | |||
Loading Pictures in Image box | Excel Programming | |||
Linked file in same folder but unknown path | Excel Programming | |||
default path for pictures | Excel Discussion (Misc queries) | |||
Copy and Paste Formula Without the linked file path | Excel Worksheet Functions |