Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 419
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default 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
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
Testing if a workbook on the network is open PJ Usher Excel Programming 3 October 26th 06 05:59 PM
testing. do not open. S S Excel Worksheet Functions 1 April 16th 06 01:16 AM
testing for open workbook Gary Keramidas[_4_] Excel Programming 7 September 27th 05 09:05 AM
Testing for an open file Nigel Excel Programming 3 July 11th 05 06:41 AM
Testing for open workbook nigelab Excel Programming 4 November 2nd 03 04:31 PM


All times are GMT +1. The time now is 07:36 AM.

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

About Us

"It's about Microsoft Excel"