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.
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.
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.
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.