View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
lopsided[_6_] lopsided[_6_] is offline
external usenet poster
 
Posts: 1
Default Test to see if a spreadsheet window is open

Dear all,

Part of my macro calls a cell value on one sheet to switch between open
windows. If the value is not typed in correctly on the first sheet then
the macro gives the error "subscript out of range", and is unable to
open the other sheet.

How can I put a test in my macro to check to see if an error will be
produced when the line is run?

I tried (amongst others):

If IsError(windows(sheetname).activate) then etc.


Any help would be greatly appretiated.

Tom


---
Message posted from http://www.ExcelForum.com/