jazznaura
02-27-2010, 01:43 PM
Hi all,
The Workbook_BeforeClose event won't work on my hidden personal.xls. It works fine if the workbook is not hidden, is there an extra bit of code required or is it not possible.
thanks,
Private Sub DeleteAddedButtons()
' '---------------------------------------------------------------------------
' '//delete the main menu buttons\\
On Error Resume Next
With Application.CommandBars("Worksheet Menu Bar")
.Controls("Refresh List").Delete
.Controls("Run Code").Delete
.Controls("Remove Mod").Delete
.Controls("Export Mod").Delete
.Controls("Import Mod").Delete
End With
'---------------------------------------------------------------------------
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Call DeleteAddedButtons
Call MenuRemovePly
End Sub
The Workbook_BeforeClose event won't work on my hidden personal.xls. It works fine if the workbook is not hidden, is there an extra bit of code required or is it not possible.
thanks,
Private Sub DeleteAddedButtons()
' '---------------------------------------------------------------------------
' '//delete the main menu buttons\\
On Error Resume Next
With Application.CommandBars("Worksheet Menu Bar")
.Controls("Refresh List").Delete
.Controls("Run Code").Delete
.Controls("Remove Mod").Delete
.Controls("Export Mod").Delete
.Controls("Import Mod").Delete
End With
'---------------------------------------------------------------------------
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Call DeleteAddedButtons
Call MenuRemovePly
End Sub