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: 226
Default testing for open workbook

i've seen almost identical code in a few place, but it doesn't work, the
variable always evaluates to nothing. why? i just need to test if the other
workbook is open and if not, open it.

Dim WBook As Workbook
'...
On Error Resume Next
Set WBook = Workbooks("Workbook2")
On Error GoTo 0
If WBook Is Nothing Then
'your sorting code
End If


--


Gary



 
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. do not open. S S Excel Worksheet Functions 1 April 16th 06 01:16 AM
Testing if file is open andreww Excel Programming 2 July 27th 05 06:07 PM
Testing for an open file Nigel Excel Programming 3 July 11th 05 06:41 AM
Testing if a file is open John Baker Excel Programming 3 January 29th 04 01:26 AM
Testing for open workbook nigelab Excel Programming 4 November 2nd 03 04:31 PM


All times are GMT +1. The time now is 03:49 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"