C
Cheng
Hi all,
Currently I am using vb.net to do automation. But I get an error message as
following:
Unable to cast COM object of type "System._Comobject' to interface type
'Microsoft.office.interop.word.application'. This operarion failed because
the QueryInterface call on the Com component for the interface with IID
'{00020970-0000-0000-C000-000000000046}' failed dude the following error:
Library not registered. (exception from HRESULT
0x8002801D(TYPE_E_LIBNOTREGISTERED)).
Testing Senario:
1.Test enviroment: Windows XP Pro. SP2, Office 2007,Reference
Microsoft.Office.Interop.Word, which is on a server (version 10)
(only office library version 12 in GAC , location C:\Windows\Assembly on
local PC not server)
The program runs smoothly, no error.
2.Test enviromen Windows XP Pro. SP2, office 2003, Reference
Microsoft.Office.Interop.Word, which is on a server (version 10)
(library version 11 and 12 in GAC , location C:\Windows\Assembly on local
PC not server)
Acction 1: Test in this enviroment: got an error : unable to cast from COM
word.applicationclass to interface type word._application (can not remember
all details)
Acction 2: Remove library version 12 from taget pc only keep version 11
results is the error I posted
Codes cause error:
Dim oApp as new Word.Application
oApp = CreateObject("Word.Application")
What shall I do to make this work on the second pc and what might cause this
problem?
Currently I am using vb.net to do automation. But I get an error message as
following:
Unable to cast COM object of type "System._Comobject' to interface type
'Microsoft.office.interop.word.application'. This operarion failed because
the QueryInterface call on the Com component for the interface with IID
'{00020970-0000-0000-C000-000000000046}' failed dude the following error:
Library not registered. (exception from HRESULT
0x8002801D(TYPE_E_LIBNOTREGISTERED)).
Testing Senario:
1.Test enviroment: Windows XP Pro. SP2, Office 2007,Reference
Microsoft.Office.Interop.Word, which is on a server (version 10)
(only office library version 12 in GAC , location C:\Windows\Assembly on
local PC not server)
The program runs smoothly, no error.
2.Test enviromen Windows XP Pro. SP2, office 2003, Reference
Microsoft.Office.Interop.Word, which is on a server (version 10)
(library version 11 and 12 in GAC , location C:\Windows\Assembly on local
PC not server)
Acction 1: Test in this enviroment: got an error : unable to cast from COM
word.applicationclass to interface type word._application (can not remember
all details)
Acction 2: Remove library version 12 from taget pc only keep version 11
results is the error I posted
Codes cause error:
Dim oApp as new Word.Application
oApp = CreateObject("Word.Application")
What shall I do to make this work on the second pc and what might cause this
problem?