Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code to check if another window is open?
I need to check if another window is open - if not I am going to display a
dialog box letting them know to open the file (or possibly opening a browse window for them to open it), and if so, just keep going |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code to check if another window is open?
Just to confrim you want to know if another file is open? If it is not open
then why not just open it yourself, something like this... dim wbk as workbook on error resume next set wbk = workbooks("MyBook.xls") on error goto 0 is wbk is nothing then _ set wbk = workbooks.open("Mybook.xls") -- HTH... Jim Thomlinson "jweasl" wrote: I need to check if another window is open - if not I am going to display a dialog box letting them know to open the file (or possibly opening a browse window for them to open it), and if so, just keep going |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code to check if another window is open?
Ok, I tried modifying the code to give a msgbox saying "Open Quote System" if
the window is not found - but it says that if the window is found or not. I guess I'm not sure of the exact wbk property - the file is a template (Quote System.xlt), when opened the default is Quote System1 - but I set wbk to Quote System1 and Quote System1.xls, it didn't work either time. "Jim Thomlinson" wrote: Just to confrim you want to know if another file is open? If it is not open then why not just open it yourself, something like this... dim wbk as workbook on error resume next set wbk = workbooks("MyBook.xls") on error goto 0 is wbk is nothing then _ set wbk = workbooks.open("Mybook.xls") -- HTH... Jim Thomlinson "jweasl" wrote: I need to check if another window is open - if not I am going to display a dialog box letting them know to open the file (or possibly opening a browse window for them to open it), and if so, just keep going |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code to check if another window is open?
This code doesn't work either
If Windows("Quote System1").Visible = True Then MsgBox "Visible" _ Else MsgBox "Not Visible" If the window is open, it will give a msgbox saying "Visible", but if it's not open it gives me an error - Subscript out of range. "jweasl" wrote: Ok, I tried modifying the code to give a msgbox saying "Open Quote System" if the window is not found - but it says that if the window is found or not. I guess I'm not sure of the exact wbk property - the file is a template (Quote System.xlt), when opened the default is Quote System1 - but I set wbk to Quote System1 and Quote System1.xls, it didn't work either time. "Jim Thomlinson" wrote: Just to confrim you want to know if another file is open? If it is not open then why not just open it yourself, something like this... dim wbk as workbook on error resume next set wbk = workbooks("MyBook.xls") on error goto 0 is wbk is nothing then _ set wbk = workbooks.open("Mybook.xls") -- HTH... Jim Thomlinson "jweasl" wrote: I need to check if another window is open - if not I am going to display a dialog box letting them know to open the file (or possibly opening a browse window for them to open it), and if so, just keep going |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How I can I open a small window within window | Excel Discussion (Misc queries) | |||
VBA line of code executes in Immediate Window but not in Code Window | Excel Discussion (Misc queries) | |||
Docking Project Explorer, Properties window and Code window in VBE | Setting up and Configuration of Excel | |||
Can't open VBA-Code Window | Excel Programming | |||
VB code to open Print window | Excel Programming |