LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Les Les is offline
external usenet poster
 
Posts: 240
Default Count open workbooks before closing

Hi all, i am not a programmer but a dabbler and i am really stuck with
counting the open workbooks. I have a search programme in excel and i have in
the beginning of the code the following "Application.IgnoreRemoteRequests =
True" when i open other workbooks, no matter how many are open i always get
only 2 open with the code below ??

Sub chkWkb()

Dim wkb As Integer
Application.IgnoreRemoteRequests = False
Application.DisplayAlerts = True

wkb = Application.Workbooks.Count
If wkb < 2 Then
Application.Quit
Else
ActiveWorkbook.Close
End If

End Sub


Am i missing someghing here ??

--
Les
 
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
Closing workbooks w/o closing Excel Barb in MD Excel Discussion (Misc queries) 3 February 15th 10 06:42 PM
count number of workbooks open Ronaldo Excel Programming 2 April 21st 05 01:00 PM
How do I stop Excel from closing the open file each time I open a. Welsin Setting up and Configuration of Excel 3 January 8th 05 11:16 PM
Closing Other Workbooks Tim Mayes[_2_] Excel Programming 4 December 13th 04 11:08 PM
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed Frank Jones Excel Programming 2 June 15th 04 03:21 AM


All times are GMT +1. The time now is 08:51 AM.

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"