Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't, I get the correct answer!!
Mike "Les" wrote: 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Les,
Not sure what you expect, but you do know what IgnoreRemoteRequests mean ? As for the number of workbooks, I would guess one is the WB containing this code and possibly the other is the hidden Personal.xls. If you are opening other .xls files by double clicking them, they would open in another instance of Excel. See point above. If you use the FileOpen or automation, they will open in this instance. So, not enough to go on to give a real answer, but check the above and see if they help. NickHK "Les" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Closing workbooks w/o closing Excel | Excel Discussion (Misc queries) | |||
count number of workbooks open | Excel Programming | |||
How do I stop Excel from closing the open file each time I open a. | Setting up and Configuration of Excel | |||
Closing Other Workbooks | Excel Programming | |||
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 | Excel Programming |