Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all
I have an excel template that sources it's validation lists from a separate workbook ("Masterlist.xls") which automatically opens and hides when the template is opened. eg: ============================================== Sub auto_open() Application.ScreenUpdating = False Workbooks.Open ("D:\Masterlist.xls") ActiveWindow.Visible = False Application.ScreenUpdating = True End Sub ============================================== I now need a "BeforeClose" code to automatically close the hidden workbook "Masterlist.xls" (without saving changes), when the template is closed. I tried this code, but I got a Compile error "Sub or Function not defined" msg on the row marked with the below. ============================================ Private Sub Workbook_BeforeClose(Cancel As Boolean) Sheets("Schedule").Select Range("a1").Select Workbook("MasterList.xls").Visible = True ActiveWindow.Close False End Sub ======================================= Thank for your help BeSmart |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error when closing file | Excel Discussion (Misc queries) | |||
Error message adaytum.xla when closing workbook in Excel 2003 | Excel Discussion (Misc queries) | |||
How do I get rid of "Compile error in hidden module" error message | Excel Discussion (Misc queries) | |||
closing excel after closing a workbook | Excel Programming | |||
EXCEL.EXE has generated an error...when closing a workbook | Excel Programming |