MariaHalt
asked on
How to Embed Excel File into Word Document (as an icon) - Getting compile error
'From within Word VBA getting
'Compile error: User-defined type not defined
'on Dim line below:
Sub InsertFile()
Dim objOLE As oleObject
Set objOLE = ActiveSheet.oleObjects.Add (FileName: ="C:\temp\ source.xls ", Link:=False, DisplayAsIcon:=True)
End Sub
'Compile error: User-defined type not defined
'on Dim line below:
Sub InsertFile()
Dim objOLE As oleObject
Set objOLE = ActiveSheet.oleObjects.Add
End Sub
ASKER
Almost there...the icon doesn't look like an Excel icon...the path to xlicons.exe seems incomplete.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The numbers were the same, the path was slightly different...
"C:\Windows\\Installer\{90 110409-600 0-11D3-8CF E-01500483 83C9}\xlic ons.exe"
Thank you.
"C:\Windows\\Installer\{90
Thank you.
"", LinkToFile:=False, DisplayAsIcon:=True, IconFileName:= _
"C:\WINNT\Installer\\xlico
IconIndex:=1, IconLabel:="Microsoft Excel Worksheet"