Saving a secure copy of the workbook without prompt

 

Purpose: saving a secure copy of the workbook without prompt

Insert the following code:

Public Function SaveSecureWorkbookToFile(Filename As String) 

Dim XLSPadlock As Object

On Error GoTo Err

Set XLSPadlock = Application.COMAddIns("GXLS.GXLSPLock").Object 

SaveSecureWorkbookToFile = XLSPadlock.SaveWorkbook(Filename)Exit Function

Err:

SaveSecureWorkbookToFile = ""

End Function 

 

You can then call the function:

Sub Test_Save()

 SaveSecureWorkbookToFile ("d:\my documents\my save.xlsc")

End Sub

 

To save the workbook in the same folder as the EXE file, do as explained in 9.1.

 


Copyright © 2021 G.D.G. Software