Hello!
I have a problem with VBA SetOption Helper. A new file can be created and saved with VBA SetOption Helper. But this file can’t be opened on some Excel editions, but on other editions it can be opened. I would like to know if I have to change the VBA code and on which edition it works and on which edition it doesn’t.
Do not allow loading/saving other workbooks (even with VBA code) is activated.
Allow loading/saving other workbooks through VBA SetOption helper ist activated, too.
A new excel file is created and then saved like this:
On Error Resume Next
Dim XLSPadlock As Object
Set XLSPadlock = Application.COMAddIns(“GXLS.GXLSPLock”).Object
XLSPadlock.SetOption Option:=“2”, value:=“0”
XLSPadlock.SetOption Option:=“1”, value:=“1”
On Error GoTo Fehlermeldung2
ActiveWorkbook.SaveAs Workbooks(“Mathe.xlsm”).Sheets(1).Range(“Pfad_Ergebnisse”).value & Workbooks(“Mathe.xlsm”).Sheets(1).Range(“Anmeldung”).value
On Error Resume Next
XLSPadlock.SetOption Option:=“2”, value:=“1”
XLSPadlock.SetOption Option:=“1”, value:=“0”
ActiveWorkbook.Close savechanges:=False
Until here everything works fine.
The code to open the file later (Some Excel editions don’t open the file now):
On Error Resume Next
Dim XLSPadlock As Object
Set XLSPadlock = Application.COMAddIns(“GXLS.GXLSPLock”).Object
XLSPadlock.SetOption Option:=“2”, value:=“0”
XLSPadlock.SetOption Option:=“1”, value:=“1”
Workbooks.Open (PathToFile(“Mathe-Ergebnisse” & Workbooks(“Mathe.xlsm”).Sheets(1).Range(“Anmeldung”).value))
XLSPadlock.SetOption Option:=“2”, value:=“1”
XLSPadlock.SetOption Option:=“1”, value:=“0”
Mathe-Ergebnisse is a subfolder of the folder where is the main Excel file Mathe.xlsm.