I have an Excel 365 spread sheet where the user is not allowed to save with incomplete data. This works fine. But I need a way to override that for my own use and save anyway. When I use the defined key combination CTRL-ALT-PGDN I get an error 'argument not optional'. What is wrong with this code?
Application.OnKey "%^{PgDn}", "Secretsave"
Public Sub Secretsave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
MsgBox "In secret save"
ThisWorkbook.Save SaveChanges = True
End Sub
I want it to save the workbook. Thanks. Any help is appreciated.
Bookmarks