Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Test to see if a spreadsheet window is open
Hi,
first loop throug all your windows with something like Sub test() For Each myWindow In Application.Windows If myWindow.Caption = "test.xls" Then found = True End If Next If found = True Then '...do something Else '... show an error message End If End Sub regards arno "lopsided" schrieb im Newsbeitrag ... 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/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Test to see if a spreadsheet window is open
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do i open a new window when opening a spreadsheet | Excel Discussion (Misc queries) | |||
How I can I open a small window within window | Excel Discussion (Misc queries) | |||
Force linked spreadsheet to open in fullsized window? | Excel Discussion (Misc queries) | |||
Can you open a new spreadsheet in a new program window? | Excel Discussion (Misc queries) | |||
How do I force a hyperlink in a spreadsheet to open a new window? | Excel Worksheet Functions |