C
Chrisso
Hi All
I have written some logic in Excel VBA which opens Word files and then
does some processing.
I am having trouble catching all the errors from opening the Word
files - my code is:
On Error GoTo OpenError
Word.Application.DisplayAlerts = False
Word.Application.Documents.Open sFullPathAndName,
ReadOnly:=True
bOpenedOK = True
Examine_ActiveDocument
Word.Application.Documents(fTarget.Name).Close False
OpenError:
If Not bOpenedOK Then Record_Error
When my code tries to open a corrupted Word file (which it cannot
open) the error handling above does not catch it and the error fails
my search. I, of course, want it to keep running until it has examined
all the Word files. When you manually try to open these files Word
says "Word experienced an error trying to open the file." Why does my
error handling not catch this case?
Thanks in advance for any ideas or suggestions,
Chrisso
I have written some logic in Excel VBA which opens Word files and then
does some processing.
I am having trouble catching all the errors from opening the Word
files - my code is:
On Error GoTo OpenError
Word.Application.DisplayAlerts = False
Word.Application.Documents.Open sFullPathAndName,
ReadOnly:=True
bOpenedOK = True
Examine_ActiveDocument
Word.Application.Documents(fTarget.Name).Close False
OpenError:
If Not bOpenedOK Then Record_Error
When my code tries to open a corrupted Word file (which it cannot
open) the error handling above does not catch it and the error fails
my search. I, of course, want it to keep running until it has examined
all the Word files. When you manually try to open these files Word
says "Word experienced an error trying to open the file." Why does my
error handling not catch this case?
Thanks in advance for any ideas or suggestions,
Chrisso