Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think this is what your after
Private Sub Workbook_BeforeClose(Cancel As Boolean) Application.DisplayAlerts = False With ThisWorkbook .Save .Close End With Application.DisplayAlerts = True End Sub "Jim" wrote: That was the code in sheet 2, and the code in ThisWorkbook is as follows: Private Sub Workbook_BeforeClose(Cancel As Boolean) Sheets("Data").Activate Columns("A:J").Select If Selection.EntireColumn.Hidden < True Then Selection.EntireColumn.Hidden = True End If sheetprot 'subroutine that protects all sheets ThisWorkbook.Save ThisWorkbook.Close End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007 - error saving file & error loading dll | Excel Discussion (Misc queries) | |||
Saving Excel 2003 Workbook in Excel 07 - Error Msg on Script obj | Excel Discussion (Misc queries) | |||
error message when saving excel workbook | Excel Discussion (Misc queries) | |||
Saving a Workbook: Forcing User to Rename before Saving | Excel Programming | |||
ChartCalculate code causing error when saving workbook | Excel Programming |