Need List of Embedded Files

L

ldb

I have a workbook with 40 +/- embedded files (Word, Excel, eMail,
PowerPoint)

I have been able to able to identify the Objects as "Object #" and
BottomRightCell address.

I appreciate any thoughts as to how get a list of the actual names of the
embedded files.

Thanks.

ldb
 
P

Peter T

Try something like this

Sub test()
Dim ot As XlOLEType
Dim ole As OLEObject

For Each ole In ActiveSheet.OLEObjects
ot = ole.OLEType

If ot = xlOLELink Then
Debug.Print ole.Name, ole.TopLeftCell.Address, ole.SourceName
ElseIf ot = xlOLEEmbed Then
Debug.Print ole.Name, ole.TopLeftCell.Address, ole.progID, " Embedded"
End If

Next
End Sub

Press Ctrl-g to see debug results in the Immediate window.

Regards,
Peter T
 
L

ldb

Thanks for your suggestion...

This provides Object specific information, but the actual filename remains
elusive - any additional thoughts?

ldb
 
P

Peter T

It depends how the file was originally embedded. If it is not "linked" to
file the original file name is lost, from now on the file will be embedded
within the host file. IOW you can't find want doesn't exist. When the file
is activated it has a file name unique to the host file, say an Excel an
embedded but not linked Excel file exists in a Word, when activated it will
show a name like "Worksheet in host-file", but you can only see that name
the newly activated Excel application, not in Word.

However if the file remains linked you should be able to return its file
name the was I suggested. What does ole.SourceName return for you.

If the above doesn't help, explain what you have (with an example of how you
created it) and what you are looking for.

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top