ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need List of Embedded Files (https://www.excelbanter.com/excel-programming/442948-need-list-embedded-files.html)

ldb

Need List of Embedded Files
 
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


Peter T

Need List of Embedded Files
 
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

"ldb" wrote in message
...
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




ldb

Need List of Embedded Files
 
Thanks for your suggestion...

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

ldb
"Peter T" <peter_t@discussions wrote in message
...
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

"ldb" wrote in message
...
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





Peter T

Need List of Embedded Files
 
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


"ldb" wrote in message
...
Thanks for your suggestion...

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

ldb
"Peter T" <peter_t@discussions wrote in message
...
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

"ldb" wrote in message
...
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








All times are GMT +1. The time now is 06:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com