SaveSecureWorkbookToFile v3

I have copied the functions from the user guide to save a secure work, but it won’t create the .xlsc or .dat file. It doesn’t error out, either. I added a msgbox to let me know if an jumps down to the err: label.

I’m using the pathtofile function as well to create the full filename string. I’ve moved the executible to c:\temp folder and ran it from there, and nothing.

What am I missing?

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)
MsgBox "inside save"
Exit Function
Err:
MsgBox "error in savesecure"
SaveSecureWorkbookToFile = ""
End Function

Sub Savesheet()

’ Savesheet Macro
’ Save the spreadsheet in xlsc formt

'
Dim pathandname As String
Dim defaultname As String

defaultname = “testsave.xlsc”

pathandname = pathtofile(defaultname)

MsgBox pathandname
SaveSecureWorkbookToFile (pathandname)
MsgBox “after save secure call”

End Sub

What are the messages shown by MsgBox when you run Savesheet()?

The first message is
image

second message:
msg2

third message:
msg3

And does the entire folder on the first message exist? You mentioned you moved everything to C:\Temp but do you have write permission there?

yes it does exist. That’s where the executable is located that I’m running. Yes, I do have write access to the temp folder. I tested it to verify that I could write a file in there and I could.

I started going down this path because I was having a problem with saving a sheet in a csv format. So I enabled “allow save but do not handle loading/saving” which got me around my issue, but then I had to figure out a way for saving the secured xlsc file. I had a different thread for this and your support suggested a better solution which allowed me to disable the “allow save but do not handle loading/saving”. So I really don’t need to figure this issue out.

OK, but we’ll try to reproduce the issue with “allow save but do not handle loading/saving” and saving the XLSC file. Normally they shouldn’t interfere but we’ll check.

Any resolution to this?
I have encountered the same problem.
SaveSecureWorkbookToFile works fine but when I recompile with ‘Allow save but do not handle loading/saving’ nothing happens.

It’s fixed in XLS Padlock 2018. Please upgrade.