gypsy Posted December 18, 2009 Share Posted December 18, 2009 (edited) When I run the script below (connected to the network with Act.Dir.), I get the following error: We intercepted a COM Error ! Number is: 800401E3 Windescription is: Operation unavailable Script Line number is: 118 Is that line 118 of my script or adfunctions.au3, which is where I think the error handling is coming from. From the editor console, I get the following: --> Word.au3 Warning from function _WordCreate, Cannot register internal error handler, cannot trap COM errors (Use _WordErrorHandlerRegister() to register a user error handler) --> Word.au3 Warning from function internal function __WordIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _WordErrorHandlerRegister() to register a user error handler) --> Word.au3 Warning from function _WordDocOpen (The specified file does not exist, but we will attempt to create it.) --> Word.au3 Warning from function internal function __WordIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _WordErrorHandlerRegister() to register a user error handler) --> Word.au3 Info from function _WordDocOpen (The specified file was created successfully.) --> Word.au3 Warning from function internal function __WordIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _WordErrorHandlerRegister() to register a user error handler) --> Word.au3 Error from function _WordDocSave, $_WordStatus_InvalidObjectType If I disconnect from the network, and comment out: ;#include <adfunctions.au3> The code runs fine and there is no COM error and I get the following on the editor console: --> Word.au3 Warning from function _WordDocOpen (The specified file does not exist, but we will attempt to create it.) --> Word.au3 Info from function _WordDocOpen (The specified file was created successfully.) I tried to implement additional error handling with the error function, but didn't have much success. Any help much appreciated. Edited December 18, 2009 by gypsy Link to comment Share on other sites More sharing options...
someone Posted December 18, 2009 Share Posted December 18, 2009 It looks like your just trying to use 2 COM error handlers at once (1 from word.au3 and one from adfunctions.au3). Word has the ability to use an exisiting COM handler by using WordErrorHandlerRegister(). For specific help with the other word warnings you'll have to post some code so we can see where you are going wrong. While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd Link to comment Share on other sites More sharing options...
gypsy Posted December 18, 2009 Author Share Posted December 18, 2009 Sorry, here is the bit of code I'm working with....test.word.au3 Link to comment Share on other sites More sharing options...
someone Posted December 18, 2009 Share Posted December 18, 2009 OK from what I see there is no error... the word file gets created and some text is inserted. _WordCreate will produce those warnings (look at the example for _WordCreate in the help file). Often each UDF will have its own com error handler. This can be a problem because you can only use 1 at a time. That is why when use the Word UDF and AD Functions UDF you get errors - each UDF is trying to load its own COM handler, plus you were trying to load your own. Read _WordErrorHandlerRegister for more information. While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd Link to comment Share on other sites More sharing options...
gypsy Posted December 28, 2009 Author Share Posted December 28, 2009 (edited) OK from what I see there is no error... the word file gets created and some text is inserted. _WordCreate will produce those warnings (look at the example for _WordCreate in the help file).Often each UDF will have its own com error handler. This can be a problem because you can only use 1 at a time. That is why when use the Word UDF and AD Functions UDF you get errors - each UDF is trying to load its own COM handler, plus you were trying to load your own. Read _WordErrorHandlerRegister for more information.Thanks for the pointer on _WordErrorHandlerRegister! Edited January 1, 2010 by gypsy Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now