Some Excel-Editions don't open a file with VBA SetOption Helper

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.

Can you list which Excel editions are faulty? And try to remove the “On Error Resume Next” to see which error is triggered by Excel with Workbooks.Open (…)

The error is: Laufzeitfehler 1004. Die Datei *.xlsx kann von Excel nicht geöffnet werden, da das Dateiformat oder die Dateierweiterung ungültig ist. Überprüfen Sie, ob die Datei beschädigt ist und ob die Dateierweiterung dem Dateiformat entspricht.

Excel 2013 Professional Plus, 2013 Home and Business and 2016 Professional Plus don’t open the file.
Excel 2016 Home and Business and 365 open the file.

Yes, the error is due to “Do not allow loading/saving other workbooks (even with VBA code)”. But since you are requesting to temporarily disable its effect with SetOption, that shouldn’t be a problem.
For Excel 2013 Professional Plus, 2013 Home and Business and 2016 Professional Plus don’t open the file. are they up-to-date regarding Microsoft updates?
And which version of XLS Padlock are you using?

Thank you for your help. I have just updated Microsoft, but Excel 2013 PP still doesn’t open the file. I am using the actual version of XLS Padlock (2021.1).

Just to be sure, could you try without the option
“Do not allow loading/saving other workbooks (even with VBA code)” to see if it works or not on the faulty computers?

I have now deactivated the option “Do not allow loading/saving other workbooks …”. That works. The file is opened.

I am still waiting for an answer. I need the option.

We still haven’t found the reason for your specific problem, and since it is not possible to find out what’s happening inside the Excel 2013 software itself without its code, I suppose that you’ll have to change the Excel version requirement for your customers. And offer a specific EXE file to customers with 2013 and without the “Do not allow loading/saving other workbooks …” option.