LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Handling Errors When Opening Word Docs From Excel VBA

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening word docs in excel doss04 Excel Discussion (Misc queries) 3 October 4th 08 06:54 PM
Microsoft Visual Basic errors displaid when opening Microsoft Word 97 & Excel (7 JJ mac Setting up and Configuration of Excel 7 June 14th 07 06:54 PM
Import cells from excel into word and create multiple word docs scdaddy7269 Excel Programming 2 March 20th 06 07:03 PM
Embedding Word Docs into Excel Worksheets and Then Printing The Word Docs mr_melvis Excel Worksheet Functions 1 April 8th 05 03:00 AM
converting excel docs to word docs rolercster New Users to Excel 2 January 4th 05 07:11 PM


All times are GMT +1. The time now is 05:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"