|How to ...|
|Using linked workbooks|
|Save Workbook as unprotected file|
Save Workbook as unprotected file.
Sometimes you need to extract part of your workbook and make it's fomulas and VBA code available to customer. This sample describes how to copy worksheet into new file and save it as usual Excel workbook.
This project and all files (locked and unlocked ones) can be downloaded from our website using this link lockxls_samples.msi.
Macro, which performs SaveAs operation, assigned to button in our example:
Method UnlockSaveAs provides unlock code to LockXLS Runtime. In our example this string is "UnlockCode", in your workbook this should be your own unlock code, which should be kept in secret.
SaveAs method saves new workbook on disk and Close - closes it.
As a result of this macro file Sheet2.xls should appear in the same folder as source file.