kenburenga
12-08-2010, 04:53 PM
I open a blank worksheet (Blank.xlsx) upon launching Excel 2010. This worksheet has all my macros (personal.xlsb).
Sub Auto_Open()
Application.WindowState = xlMaximized
Workbooks.Open Filename:= _
"C:\Users\KLB-Laptop\Documents\My Templates\Blank.xlsx"
ChDir "C:\KLBSheets"
End Sub
If I close the blank worksheet with the CloseSheet macro the worksheet is closed but my macros are still available for the next worksheet I open.
Sub CloseSheet()
Workbooks(2).Close
End Sub
However, if I include Call CloseSheet in my Auto_Open macro the blank sheet is closed but then Book1 is left open.
I want to be able to launch Excel, close all open worksheets, but still have my personal.xlsb macros available for the next worksheet I open
Any clues as to why the Call CloseSheet leaves Book1 open?
Sub Auto_Open()
Application.WindowState = xlMaximized
Workbooks.Open Filename:= _
"C:\Users\KLB-Laptop\Documents\My Templates\Blank.xlsx"
ChDir "C:\KLBSheets"
End Sub
If I close the blank worksheet with the CloseSheet macro the worksheet is closed but my macros are still available for the next worksheet I open.
Sub CloseSheet()
Workbooks(2).Close
End Sub
However, if I include Call CloseSheet in my Auto_Open macro the blank sheet is closed but then Book1 is left open.
I want to be able to launch Excel, close all open worksheets, but still have my personal.xlsb macros available for the next worksheet I open
Any clues as to why the Call CloseSheet leaves Book1 open?