
Checking for Active Word App
GetObject asks for a path name of a file and if the file
isn't open, it crashes as well. I need to somehow check to
see if a file, document or workbook IS in fact open in
order to avoid these crashes.
Thank you
Quote:
>-----Original Message-----
>On Tue, 8 Oct 2002 08:47:39 -0700, "Farsad Nasseri"
> Hi
>
> I have a program that requires the opening of Excel and
> Word files. On Error, the Routine goes to and Error
> handler that displays the error msg and tries to save
and
> close both word and excel files.
> The problem occurs when the Error takes place on
opening
> the word or excel file. Upon the occurance of the
Error,
> it goes to the error handler, displays the msg and then
> tries to close a file that doesn't exist b/c it
couldn't
> be openned. I was wondering if there was a way in the
> error handler to check to see if a word or excel file
or
> document is open before trying to close it?
>
> This would stop my program from crashing.
>
> thank you very much in advance
>Have you tried using the GetObject function?
>Microsoft MVP (Visual Basic)
>.