Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Testing if a workbook is open
Hello all,
How do I test if a workbook is open. I have some code set up where I copy some data from a source file into a destination file. This code needs to be run 14 times per source file. I have the code set to close the source file after the 14th copy process. At the end of each copy process, I have the code switch to the source file. Well, if the source file is closed after the 14th copy process, then there is no source file for the code to switch back to when it is done, and I get an error. Thanks for any help anyone can provide, Conan Kelly |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Testing if a workbook is open
On error Resume Next Set oWB = Workbooks("myBook.xls") On Error Goto 0 If oWB Is Nothing Then Msgbox "workbooks is not open ... -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Conan Kelly" wrote in message ... Hello all, How do I test if a workbook is open. I have some code set up where I copy some data from a source file into a destination file. This code needs to be run 14 times per source file. I have the code set to close the source file after the 14th copy process. At the end of each copy process, I have the code switch to the source file. Well, if the source file is closed after the 14th copy process, then there is no source file for the code to switch back to when it is done, and I get an error. Thanks for any help anyone can provide, Conan Kelly |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Testing if a workbook on the network is open | Excel Programming | |||
testing. do not open. | Excel Worksheet Functions | |||
testing for open workbook | Excel Programming | |||
Testing for an open file | Excel Programming | |||
Testing for open workbook | Excel Programming |