Application creating a non-protected workbook [solved]

Hello everyone,
I would like to use XLS Padlock to protect a workbook which creates another one, without having the new one protected (I don’t want the user to see the code, and “basic” Excel protection seems easy to crack).

I created a “tool” consisting in two workbooks :

  • a workbook containing input data, which does not need to be protected,
  • a workbook containing VBA procedures, which needs to be protected.

The second workbook uses the first one to create a third workbook containing output data. I would like this third workbook to be a “simple” excel file.

I have seen a similar post ( Saving/Exporting Data out of an XLS Padlock protected file ) but I don’t understand the code which is proposed in the topic.

Is there a solution ?

Thank you !

PS : I am French, therefore I might have made some mistakes in my message… And I apologize for this.

There is a solution but it requires some VBA work.

Your protected workbook will be stored in a virtual folder, so it will not be able to know where the first input data workbook is located. Fortunately, we provide a way in VBA to get the folder where the EXE file is located.

See this post:

So you have to place your input workbook in the same folder as the EXE (which is the protected workbook) and use the VBA code to get the full path to the input workbook, so that your protected workbook can open it and process data.

It’s possible to create the third workbook with VBA. XLS Padlock doesn’t prevent new workbooks from being saved or created from VBA.

Thank you for your quick reply.

I had already written a code to make the exe “find” the input workbook, therefore it is not a problem for me.
My problem is that when the ouptut workbook is created, it seems to be also protected (the only option is “print”), and is not saved as a .xlsx in the current folder (yet one of my procedure specifies “Workbooks(Output_file).Save”).
I would like this output workbook to be unprotected, and I wonder whether it is possible.

Ok, for some reason today I don’t even manage to call my protected file from my input workbook.

This is how it works :
the user “calls” the protected workbook by clicking an Activex control located in the input workbook.

The code used to be (when the main workbook wasn’t protected) :
InputWbk = ThisWorkbook.Name
Application.Run “MainWbk.xlsm!Procedure.Module”, InputWbk

I have change it this way :

Public Function CallXLSPadlockVBA(ID As String, Param1)
Set XLSPadlock = Application.COMAddIns(“GXLSForm.GXLSFormula”).Object
CallXLSPadlockVBA = XLSPadlock.PLEvalVBA(ID, Param1)
End Function

and in the procedure linked to the Activex control :
o = CallXLSPadlockVBA(“Procedure”, “”)

But I get an error message saying that the Procedure couldn’t be found.

I am sure that I did something wrong, but I don’t know what…

Problem solved !

I used “thisworkbook.path” in the code to know where the files were located (to save the output workbook) , “this workbook” being the protected one. This is why I couldn’t find any output file, since the path was wrong.

I “cheated” by getting the path of the input workbook instead, which has to be located in the same folder as the protected one.

Thank you for the follow-up