File already open!!!

vb6 , filealreadyopne , openfile India
  • 12 years ago
    Hi...All My macro written in excel sheet opens a word doc and exports the data from excel to word. If the word doc is already open macro gives an run time error or hangs up. i want my macro to check whether the file is open or not? if open give a message...is this possible...? regards, SK
  • 12 years ago
    Hi, I am not sure if you can check if the file is open , other than to get the active word instance by calling getobject and seeing if it returns a word instance and then looking through the documents for the one you want to open. Simpler would be to use structured error handling, try to open the file, and then catch the error to determine what has happened and handle it from there. Regards Si

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Nine people can't make a baby in a month.” - Fred Brooks