Another VBA compiler problem

Hello,

I’m still looking for the solution of the compiler problem. I always get the following error:

grafik

Why does the first sub work fine and the second one produces this error? It doesn’t matter what I put in the second Sub. So my questions about protecting and calculating sheets are not actual any more. I always get this error. Does anybody have an idea?

Thank you very much.

'Write here subs to be protected with compilation
'These subs can then be invoked at runtime with PLEvalVBA function.
Sub MyProtectedSub(Param1)
'Place the code you want to protect here.
MsgBox (“This is a demo”)
End Sub
Sub MyProtectedSub2(Param1)
'Place the code you want to protect here.
End Sub

Sub Einstell(Param1)
Application.ThisWorkbook.Sheets(2).Cells(76, 1).Value = “Calculate”
End Sub

Sub Aktual(Param1)
Application.ThisWorkbook.Sheets(2).Cells(76, 1).Value = “Calc”
End Sub

Make sure that your Excel workbook file is not in a OneDrive-managed folder. This error occurs when XLS Padlock at design time is not able to find the compiled bytecode file in the same folder as the Excel workbook file.

Hello!
Can you tell me, what is wrong with this short sub?

Sub aktualisieren_Abfrage2(Param1)
Application.ActiveSheet.Calculate
End Sub

I don’t understand the compiler. Why do I always get the error that I have to recompile the code?

Thank you very much!

See above. Your code compiles fine.

Thank you very much for your help on a Saturday.
I have a main file with the code and several files that use the main file’s code. In that case is it impossible to use the compiler?

Thank you very much again and have a nice weekend

It depends: do you plan to include the other files into the EXE file too thanks to the Companion Files feature of XLS Padlock? If yes, then it’s possible to call compiled code from other files.
Otherwise, your case will certainly be more fit for our future VBA compiler software.

Thank you!!! Yes, my other files are companion files. How can I use the compiler now?
Greetings and have a nice day!

Just use the same VBA PLEvalVBA function to invoke the compiled VBA code as in your main workbook. The VBA code will work since it is available in the entire Excel secure session.