S Oberlander
Board Regular
- Joined
- Nov 25, 2020
- Messages
- 147
- Office Version
- 365
- Platform
- Windows
My excel file is blocked from savings with a beforeclose even handler, however, to offer an alternative way to save I created the below sub.
It works great when I step thru it, but when I just click on the button linked to it, it tries to save the blocked workbook so nothing gets saved...
It works great when I step thru it, but when I just click on the button linked to it, it tries to save the blocked workbook so nothing gets saved...
VBA Code:
Sub savecopy()
Sheets("Pivot").Copy
ActiveSheet.Shapes.Range(Array("Button 1")).Delete
With Application.FileDialog(msoFileDialogSaveAs)
.InitialFileName = ThisWorkbook.Path & "\"
If .Show Then .Execute
End With
End Sub