How to use PathToFile and SaveSecureWorkbookToFile together

ricdam

New member
Hi there,

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
Thanks
 
Last edited:
Try
Code:
Sub Test_Save()
SaveSecureWorkbookToFile (PathToFile("MySave.xlsc"))
End Sub
 
Last edited:
Hi Support,

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?


Thanks,
 
Last edited:
ricdam said:
  1. Can I assume this (file gets saved in the user’s My Documents folder) will happen to all users that run the macro?
Sure, each user has its own My Documents folder.
ricdam said:
  1. 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?
That’s because SaveSecureWorkbookToFile doesn’t write a reference into the history file.
 
gdgsupport said:
That’s because SaveSecureWorkbookToFile doesn’t write a reference into the history file.
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?

Cheers,
 
gdgsupport said:
We’ll check this possibility for the next update.
Thanks. The SaveSecureWorkbookToFile is useless if it makes harder to open the file. Getting this sorted would be great.

Just for my information, any idea when will be the new update available?

Cheers,
 
Back
Top