When working with secure Excel workbooks, it’s often necessary to perform specific actions immediately after a save operation. The following feature is particularly useful for developers looking to add custom post-save functionalities, such as logging activities, notifying users, or triggering other processes.
XLS Padlock invokes the following VBA callback: XLSPadlock_OnAfterSave. By including this subroutine in your VBA project, XLS Padlock will automatically invoke it each time the workbook is saved.
Implementing XLSPadlock_OnAfterSave
To leverage this feature, you simply insert a subroutine named XLSPadlock_OnAfterSave into your VBA module. The subroutine must have one parameter, SaveFilename, which is a string passed by XLS Padlock that contains the full path to the saved secure workbook file.
Here’s a basic implementation of this subroutine:
Sub XLSPadlock_OnAfterSave(SaveFilename As String)
MsgBox "The workbook has been successfully saved as: " & SaveFilename
End Sub
The example above provides a simple message box that informs the user of the save operation's success and shows the file path of the saved workbook.