Save during execution defaults to old directory

StevegHI

Member
(XLSPadlock downloaded a couple of months ago; love the product).

Loaded.exe file by double clicking on “F:\VBA Projects\Checkin_1.2\XLSPadlock_2022_0122\MIC_1.2.exe”

Click File, Save
MIC_1.2 Spreadsheet wants to save in “F:\VBA Projects**Checkin_1.1” directory as a secure Excel File.

Did mic_1.2.exe -del
Looked through the .xplp files and registry for Checkin_1.1.

When I rename Checkin_1.1 to something else, spreadsheet wants to save in Documents.

What am I missing? What am I doing wrong?
 
Last edited:
Nothing wrong, the EXE tries to set the default save directory to the previous folder chosen by the customer. If the folder is not found, it reverts to the usual Documents folder.
 
I haven’t used that previous folder (“F:\VBA Projects**Checkin_1.1”) for several weeks. It keeps reverting back. I’m up to Checkin_1.2 and had to manually save there. I understand Documents is the default if it doesn’t find the folder. This Checkin_1.1 is kept somewhere. Why would it not update to the Checkin_1.2?

Is there a way to manually update the default save library? Could I have something in the code that is triggering it?
 
Will do.

Tried the test with the subroutine … Ran debug It gave me a “Subscript out of range” error on the following:

Set XLSPadlock = Application.COMAddIns(“GXLS.GXLSPLock”).Object

The routine would surely need to be called when the user clicks “Save” or closes the workbook and selects “Save.” How do I hook it in?
 
Last edited:
Be sure to copy the entire code. The object is available only in the EXE form and will trigger that error if run in normal Excel if you don’t use the entire VBA code.
You can for instance call the routine with the Workbook_Open VBA event.
Instead of a full filename, you can also just try to specify the initial folder.
 
If comes up with the correct .exe path. I even shoved a MSGBOX in to confirm. When I try to save, it still goes to the obsolete path. Is there a true “Set” function?

Did a little research. Could it be the settings.dat file in the C:\Users\micsg\AppData\Roaming\XLSPadlock\UserApplication{___} directory?

(redacted the ID)
 
Last edited:
Yes, the file saves are also referenced into this file. You can try to rename it to settings0.dat to see if it helps.
 
In the C:\Users\micsg\AppData\Roaming\XLSPadlock\UserApplication directory, there were about 9 directories, each with a different GUID. I moved all of those directories somewhere else. Opened XLSM, compilted it, then exited. I then opened up the .exe file and tried to save. The save still showed the old directory checkin_1.1. Must be somewhere else…registry? Search turned up empty.
 
Could you please take a screenshot to show us where you see the “The save still showed the old directory checkin_1.1”?
 
This problem has seemed to come back somehow. On 2025.1. The save dialog box still uses the previous save directory. Tried using SetSecureWorkbookFilename with both "F:\VBA Projects\Checkin_1.3\XLSPadlock_2025_1003\*.xlsc" and "F:\VBA Projects\Checkin_1.3\XLSPadlock_2025_1003\test.xlsc" It brought up the previous one: "D:\$P\$C\Waiakea Villas\YR2025\Electronic Voting" in the Save As dialog box.

Anything to force the directory to change? I opened up F11 and allowed myself to observe VBA code in the compiled version for debugging so I could check and alter the parameters in an attempt to change the save as dialog box. The dialog box is displayed when the Workbook_Aftersave routine exits.
 
Okay, tested it out on 2025.2. Did a A3=SetSecureWorkbookFilename(A1) where A1="H:\Xfer*.xlsc
It appears to get the directory correct. The save screen looks like the following:
1762935344185.webp
It appears that I need to call the routine once with the directory name followed by a "\" and again with the file name. Is this by design? Is there another way to separate the filename from the default directory name so the default file name can also be provided? Perhaps another subroutine?
 

Attachments

  • 1762935300656.webp
    1762935300656.webp
    17.1 KB · Views: 1
Okay, tested it out on 2025.2. Did a A3=SetSecureWorkbookFilename(A1) where A1="H:\Xfer*.xlsc
It appears to get the directory correct. The save screen looks like the following:
View attachment 3228
It appears that I need to call the routine once with the directory name followed by a "\" and again with the file name. Is this by design? Is there another way to separate the filename from the default directory name so the default file name can also be provided? Perhaps another subroutine?
Yes, SetSecureWorkbookFilename allows you to enforce the save directory currently displayed. If you provide a full path, the directory will be extracted, and if it exists, it will be used as the default save location.
 
Back
Top