If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Command failed and other spurious errors
Hi,
Using javascript we manage word documents that are in another IE frame. It works, except sometimes that we get very ununderstandable errors. For example: a) Today we get a 'command failed' error on a oDocument.SaveAs(sFile,0) statement. Why? b) Sometimes the sequence: oDocument.SaveAs(sFileTmp,0); oDocument.SaveAs(sFile,0); bFlag = oDocument.Saved; retains sFileTmp in use (other applications can't open it) and bFlag is false. Why? c) Sometimes executing bFlag = oDocument.Saved; throws an exception, but the message is blank. Why? Thanks, Alfons |
#2
|
|||
|
|||
Hi Alfons,
In case you hadn't noticed, you've posted this in an end-user newsgroup. Little chance of getting an automation question answered in here! If I had a concrete idea, I'd tell you, but I have no experience with javascript or IE. Command failed basically means that Word is unable to perform the actin in its current state. At the moment, I can't imagine what could cause SaveAs to fail, unless you're passing an invalid path or file name. If that's not the case, then I recommend you take a look at the list of office.developer newsgroups, read some of the messages, then post to the group that seems most appropriate. Using javascript we manage word documents that are in another IE frame. It works, except sometimes that we get very ununderstandable errors. For example: a) Today we get a 'command failed' error on a oDocument.SaveAs(sFile,0) statement. Why? b) Sometimes the sequence: oDocument.SaveAs(sFileTmp,0); oDocument.SaveAs(sFile,0); bFlag = oDocument.Saved; retains sFileTmp in use (other applications can't open it) and bFlag is false. Why? c) Sometimes executing bFlag = oDocument.Saved; throws an exception, but the message is blank. Why? Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
#3
|
|||
|
|||
Hi Cindy,
When the error is produced I display all the variables, and the Path and filename are both correct. I have also posted the same message to other newsgroups (oleinterop and application.errors) without success (for the moment). "Cindy M -WordMVP-" escribió: Hi Alfons, In case you hadn't noticed, you've posted this in an end-user newsgroup. Little chance of getting an automation question answered in here! If I had a concrete idea, I'd tell you, but I have no experience with javascript or IE. Command failed basically means that Word is unable to perform the actin in its current state. At the moment, I can't imagine what could cause SaveAs to fail, unless you're passing an invalid path or file name. If that's not the case, then I recommend you take a look at the list of office.developer newsgroups, read some of the messages, then post to the group that seems most appropriate. Using javascript we manage word documents that are in another IE frame. It works, except sometimes that we get very ununderstandable errors. For example: a) Today we get a 'command failed' error on a oDocument.SaveAs(sFile,0) statement. Why? b) Sometimes the sequence: oDocument.SaveAs(sFileTmp,0); oDocument.SaveAs(sFile,0); bFlag = oDocument.Saved; retains sFileTmp in use (other applications can't open it) and bFlag is false. Why? c) Sometimes executing bFlag = oDocument.Saved; throws an exception, but the message is blank. Why? Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
Thread Tools | |
Display Modes | |
|
|