paddysheeran
03-23-2012, 04:15 AM
Hi All,
I now use Excel 2010 and have been getting a error message when running a piece of code:
wdDoc.Activate
Set t = wdDoc.Bookmarks("Section10_File").Range
t.InlineShapes.AddOLEObject ClassType:="Excel.Sheet.12", Filename:= _
GlobalFolder & "Device Compliance Audit.xlsx" _
, LinkToFile:=False, DisplayAsIcon:=True, IconFileName:= _
"C:\WINDOWS\Installer\{90120409-6000-11D3-8CFE-0150048383C9}\xlicons.exe" _
, IconIndex:=1, IconLabel:="Section 10 Data"
The Error message is:
"The program used to create this object is Excel. That program is either not installed on your computer or it is not responding. To edit this object, install Excel or ensure that any dialog boxes in Excel are closed"
When the error appears I have to click OK. I then get a the debug error message:
Run-time error '4198': Command Failed
When I then press debug the following is highlighted:
t.InlineShapes.AddOLEObject ClassType:="Excel.Sheet.12", Filename:= _
GlobalFolder & "Device Compliance Audit.xlsx" _
, LinkToFile:=False, DisplayAsIcon:=True, IconFileName:= _
"C:\WINDOWS\Installer\{90120409-6000-11D3-8CFE-0150048383C9}\xlicons.exe" _
, IconIndex:=1, IconLabel:="Section 10 Data"
If I then press the Continue Button (F5) without any amendments the rest of the code runs through to completion even though I have 3 other identical pieces of code (to insert files) that run through without any other errors.
So my issue is why this error message presents itself/what can be done to stop this from happening. If it cant is there any other way to insert files into my word document?
many thanks in advance.
Paddy.
I now use Excel 2010 and have been getting a error message when running a piece of code:
wdDoc.Activate
Set t = wdDoc.Bookmarks("Section10_File").Range
t.InlineShapes.AddOLEObject ClassType:="Excel.Sheet.12", Filename:= _
GlobalFolder & "Device Compliance Audit.xlsx" _
, LinkToFile:=False, DisplayAsIcon:=True, IconFileName:= _
"C:\WINDOWS\Installer\{90120409-6000-11D3-8CFE-0150048383C9}\xlicons.exe" _
, IconIndex:=1, IconLabel:="Section 10 Data"
The Error message is:
"The program used to create this object is Excel. That program is either not installed on your computer or it is not responding. To edit this object, install Excel or ensure that any dialog boxes in Excel are closed"
When the error appears I have to click OK. I then get a the debug error message:
Run-time error '4198': Command Failed
When I then press debug the following is highlighted:
t.InlineShapes.AddOLEObject ClassType:="Excel.Sheet.12", Filename:= _
GlobalFolder & "Device Compliance Audit.xlsx" _
, LinkToFile:=False, DisplayAsIcon:=True, IconFileName:= _
"C:\WINDOWS\Installer\{90120409-6000-11D3-8CFE-0150048383C9}\xlicons.exe" _
, IconIndex:=1, IconLabel:="Section 10 Data"
If I then press the Continue Button (F5) without any amendments the rest of the code runs through to completion even though I have 3 other identical pieces of code (to insert files) that run through without any other errors.
So my issue is why this error message presents itself/what can be done to stop this from happening. If it cant is there any other way to insert files into my word document?
many thanks in advance.
Paddy.