Purpose: open an existing save file with VBA
It is possible to open a save file of your application using VBA code. However, please note that the file will be loaded in a new instance of Excel and not in the current instance. This is the same as starting the EXE file a second time.
Insert the following code (for instance in a module):
Public Sub LoadXLSPadlockSaveFile(FilePath As String)
On Error Resume Next
Set XLSPadlock = Application.COMAddIns("GXLSForm.GXLSFormula").Object
For instance, the following macro (to be associated to a button) will prompt end users for the XLSC save file they want to open, and then open it:
strFileToOpen = Application.GetOpenFilename _
(Title:="Please choose a save file to open", _
FileFilter:="Save Files (*.xlsc),*.xlsc")
If strFileToOpen = False Then
MsgBox "No file selected.", vbExclamation, "Error"
Copyright © 2022 G.D.G. Software