Skip to main content
May 8, 2006
Question

MSXML 4.0 needed for COM object invocation?

  • May 8, 2006
  • 1 reply
  • 460 views
Hi,

Do I need MSXML 4.0 for the <CFOBJECT> tag to worK? Coz I dont have this right now and I am gettign the following error when i try to instantiate a COM object.
Error:
"An exception occurred when instantiating a Com object. The cause of this exception was that: coldfusion.runtime.com.ComObjectInstantiationException: An exception occurred when instantiating a Com object..
The error occurred on line 5. "

Code:
<HTML>
<HEAD>
<TITLE> Test</TITLE>
</HEAD>
<CFOBJECT TYPE="COM" NAME="MyWord" CLASS="WINWORD.EXE" ACTION="Connect" CONTEXT="Local">

<CFSET MyWord.Visible="False">
<CFSET OriginalDoc=MyWord.Documents>
<CFSET OriginalDoc.Open("C:\wwwroot\test.doc")>
<CFSET ConvertedDoc=MyWord.ActiveDocument>
<CFSET ConvertedDoc.SaveAs("C:\wwwroot\Test\test.html",Val(8))>
<CFSET MyWord.Quit()>
<CFSET ReleaseComObject(MyWord)>
<BODY>
<TABLE>
<TR>
<TD><A HREF="www.yahoo.com">Yahoo</A></TD>
</TR>
</TABLE>
</BODY>
</HTML>

Thanks
This topic has been closed for replies.

1 reply

Inspiring
May 8, 2006
With my novice knowledge ot COM objects, I believe your class should be "Word.Application".
May 8, 2006
Actually, it was that only and the Action was Create when I got the message. I by chance the posted the modified code which I had modified for testing.

Any ideas now?

Thanks
May 8, 2006
Hi,

I installed MSXML 4.0 and now I am getting a slightly different error:
" An exception occurred when instantiating a Com object. The cause of this exception was that: coldfusion.runtime.com.ComProxy$ComObjectConnectionException: An exception occurred when trying to connect to an active Com object.. "

Any Ideas?

Thanks