Hi,
I am having trouble using the Workbooks_BeforeClose procedure in excel. Macros seems to be enabled because in order the use the spreadsheet the user must click a button with a macro assigned to it. Unfortunately, when the workbook is closed and reopened to procedure I assigned to the close never executes. Here is the code:
Why is this not executing?
I am having trouble using the Workbooks_BeforeClose procedure in excel. Macros seems to be enabled because in order the use the spreadsheet the user must click a button with a macro assigned to it. Unfortunately, when the workbook is closed and reopened to procedure I assigned to the close never executes. Here is the code:
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheets("Prospects").Select
Sheets("Welcome Page").Visible = True
Application.Run "BLPLinkReset"
Sheets("Prospects").Select
Application.Run "BLPLinkReset"
Sheets("Prospects").Select
ActiveWindow.SelectedSheets.Visible = False
Application.Run "BLPLinkReset"
ActiveWorkbook.Protect Password:="Password", Structure:=True, Windows:=False
ActiveWorkbook.Save
End Sub
Why is this not executing?