Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Win32::OLE create object failing

by gellyfish (Monsignor)
on Sep 10, 2006 at 07:59 UTC ( [id://572202]=note: print w/replies, xml ) Need Help??


in reply to Win32::OLE create object failing

On determining that $word is undefined you should print the value of Win32::OLE->LastError() - something like:

if (! $word ) { die Win32::OLE->LastError(),"\n"; }
However from the warning that you are getting it does look like that all or part of the Word COM server is not registered. You can check this using the OLE Browser that comes with the Activestate Perl (or the one that comes with the Microsoft SDK if you have that,) or at a push you can compare the registry entries from a machine where this is working using regedit (i.e. search for Word.Application ). Probably the best way to repair this would be to re-install word, but you could re-register the COM server using regsrvr32 (i.e. something like regsrvr32 /i winword.exe but I don't have a windows machine to test it at the moment.)

/J\

Replies are listed 'Best First'.
Re^2: Win32::OLE create object failing
by esr (Scribe) on Sep 11, 2006 at 14:47 UTC
    Thanks. A registry search on the two machines showed that there were several differences and there was a lot of Word stuff not registered. The "registry server" program did not accept the winword.exe input as suggested but I did discover an (undocumented) "startup switch" for Word.

    Entering "winword /r" in the "DOS prompt" (aka Run) window rebuilt the needed registry entries. The description of this switch says that it "Starts Word, starts Setup, makes changes in the Windows registry, and then quits. This switch forces a re-register of Word in the Windows registry."

    My programs are working again. :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://572202]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-26 00:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found