Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Checking for workbooks


Hi!
I would like to write code that checks to see how many workbooks
(windows) are open on this application. Can someone help me?
I have code that goes to the next active window and copies a specified
range. If there is no other workbook open or if there is more than 1
other workbook open then I want to display a message box that instructs
the user and stops the macro.
Thanks for your time!


--
Brian Matlack
------------------------------------------------------------------------
Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508
View this thread: http://www.excelforum.com/showthread...hreadid=510541

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Checking for workbooks

Hi Brian,

Try:

If Not Workbooks.Count = 2 Then
'your warning
Exit Sub
End if


---
Regards,
Norman


"Brian Matlack"
wrote in message
news:Brian.Matlack.22ys4a_1139492101.8355@excelfor um-nospam.com...

Hi!
I would like to write code that checks to see how many workbooks
(windows) are open on this application. Can someone help me?
I have code that goes to the next active window and copies a specified
range. If there is no other workbook open or if there is more than 1
other workbook open then I want to display a message box that instructs
the user and stops the macro.
Thanks for your time!


--
Brian Matlack
------------------------------------------------------------------------
Brian Matlack's Profile:
http://www.excelforum.com/member.php...fo&userid=3508
View this thread: http://www.excelforum.com/showthread...hreadid=510541



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Checking for workbooks

Hi Brian

Note:

Workbooks.Count
This count also hidden workbooks(personal.xls)

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Norman Jones" wrote in message ...
Hi Brian,

Try:

If Not Workbooks.Count = 2 Then
'your warning
Exit Sub
End if


---
Regards,
Norman


"Brian Matlack" wrote in message
news:Brian.Matlack.22ys4a_1139492101.8355@excelfor um-nospam.com...

Hi!
I would like to write code that checks to see how many workbooks
(windows) are open on this application. Can someone help me?
I have code that goes to the next active window and copies a specified
range. If there is no other workbook open or if there is more than 1
other workbook open then I want to display a message box that instructs
the user and stops the macro.
Thanks for your time!


--
Brian Matlack
------------------------------------------------------------------------
Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508
View this thread: http://www.excelforum.com/showthread...hreadid=510541





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Checking for workbooks


Ron de Bruin Wrote:
Hi Brian

Note:

Workbooks.Count
This count also hidden workbooks(personal.xls)

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Norman Jones" wrote in messag
...
Hi Brian,

Try:

If Not Workbooks.Count = 2 Then
'your warning
Exit Sub
End if


---
Regards,
Norman


"Brian Matlack

wrote i
message
news:Brian.Matlack.22ys4a_1139492101.8355@excelfor um-nospam.com...

Hi!
I would like to write code that checks to see how many workbooks
(windows) are open on this application. Can someone help me?
I have code that goes to the next active window and copies

specified
range. If there is no other workbook open or if there is more tha

1
other workbook open then I want to display a message box tha

instructs
the user and stops the macro.
Thanks for your time!


--
Brian Matlack


------------------------------------------------------------------------
Brian Matlack's Profile

http://www.excelforum.com/member.php...fo&userid=3508
View this thread

http://www.excelforum.com/showthread...hreadid=510541



Works Great!! Thanks!

--
Brian Matlac
-----------------------------------------------------------------------
Brian Matlack's Profile: http://www.excelforum.com/member.php...nfo&userid=350
View this thread: http://www.excelforum.com/showthread.php?threadid=51054

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
Copy/ move selected data from workbooks to seperate worksheets or workbooks Positive Excel Worksheet Functions 1 August 30th 07 04:54 PM
Spell Checking with checking cell notes jfitzpat Excel Discussion (Misc queries) 0 August 8th 07 10:26 PM
Display 2 formulas from source workbooks to destination workbooks Excel_seek_help Excel Discussion (Misc queries) 4 April 27th 06 08:13 PM
Checking to see how many workbooks are visible Andrew Excel Discussion (Misc queries) 2 August 19th 05 01:27 PM
checking other pages and workbooks for repeating numbers? Done Right Excel Discussion (Misc queries) 0 July 24th 05 01:01 PM


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