Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I make an open workbook the active workbook
Looking at the code provided it appears that you want to open if closed or
activate if not the active workbook. Sub ActivateMyWorkbook() 'from MS On Error GoTo ErrorHandler Workbooks("Book2.xls").Activate 'The following line will halt the macro before the error handler 'is reached. Exit Sub ErrorHandler: Workbooks.Open FileName:="Book2.xls" End Sub -- Don Guillett SalesAid Software wrote in message ... I have a workbook that is open, and would like to make it the active workbook. I tried this code, but it does not work. Can anyone tell me how to do this? If (Not UtilitiesWorkbookIsOpen("myWorkbook.xls")) Then MsgBox "Please open myWorkbook.xls" Exit Sub Else ThisWorkbook.Activate End If |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
When I open a workbook, cell protection is not fully active | Excel Worksheet Functions | |||
how to open a workbook per active window | Excel Discussion (Misc queries) | |||
Why does a new Excel Workbook open with IV1 as the active cell? | Excel Discussion (Misc queries) | |||
copy worksheet from closed workbook to active workbook using vba | Excel Worksheet Functions | |||
Preventing opening workbook inside active workbook. | Excel Programming |