Hi All,
I am attempting to open a worksheet object that is embedded in a PowerPoint presentation. The code below finds and selects the embedded object fine the problem lies in my syntax to open the document. anyone have any thoughts?
Thanks,
Jim
I am attempting to open a worksheet object that is embedded in a PowerPoint presentation. The code below finds and selects the embedded object fine the problem lies in my syntax to open the document. anyone have any thoughts?
Code:
ThisEmbdName = Shape.Name
Shape.Select
If Shape.Type = Office.MsoShapeType.msoEmbeddedOLEObject Then
ThatType = Shape.OLEFormat.progID
If InStr(ThatType, "Microsoft Excel") > 0 Or InStr(ThatType, "Microsoft Word ") > 0 _
Or InStr(ThatType, "Microsoft PowerPoint") > 0 Or InStr(ThatType, "Adobe Acrobat") > 0 _
Or InStr(ThatType, "Chart") > 0 Or InStr(ThatType, "Word.Document") > 0 _
Or InStr(ThatType, "Excel.Sheet") > 0 Then
Set Embd = CreateObject(Class:="Excel.Sheet")
'Open the Document
Embd.Worksheet.Open Filename:=ThisEmbdName
End If
End If
Thanks,
Jim