I’m struggling to make these two VBAs to work together.
What location or code I need to put inside the sub SaveSecureWorkbookToFile to save in the same location of the exe file?
I’m using:
Public Function PathToFile(Filename As String)
Dim XLSPadlock As Object
On Error GoTo Err
Set XLSPadlock = Application.COMAddIns(“GXLSForm.GXLSFormula”).Object
PathToFile = XLSPadlock.PLEvalVar(“EXEPath”) & Filename
Exit Function
Err:
PathToFile = “”
End Function
And
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
and to call:
Sub Test_Save()
SaveSecureWorkbookToFile (WHAT SHOULD I PUT HERE)
End Sub
I figured out that actually you just need the file name inside the brackets, like SaveSecureWorkbookToFile (“MySave.xlsc”), and the xlsc file will get saved in the My Documents folder.
Two questions:
1) Can I assume this (file gets saved in the user’s My Documents folder) will happen to all users that run the macro?
2) And why when I reopen the EXE file and choose “Last save”, it doesn’t open the xlsc file saved through the SaveSecureWorkbookToFile macro? How to fix it?
So how can we overcome this? Is there a macro, or a line of code to write a reference into the history file?
If not, would that be possible to fix in the next XLS Padlock version?