Creating Backups For Post Web Update Data Restoration?

Hermannjt

New member
I have my compiled Workbook set up for automatic Web Updates and somewhere in the documentation there exists the recommendation to have the end user create a backup copy to be able to restore certain, user specific data. This application relies on VBA and numerous workbook scoped named ranges to store/retrieve certain user specific information and has ~ 20 user editable, data-validated, dropdown lists that are accessible for use in userform list boxes. Having a use-default backup is important in cases where the user Deactivates the app on one device in order to transfer it to another device.

I learned the hard way that if I open a previous, pre-update, version of *.xlsc in the updated version that it actually loads the previous version of the app thereby nullifying the update.

What suggestions does anyone have to create a backup where the named ranges and data contained in them remains intact?

Thanks in advance for your assistance.
 
What you saw is the normal behavior of the Full Save mode. An .xlsc file is a complete snapshot of the workbook, including its sheets, formulas and VBA code. Loading it replaces the workbook embedded in the EXE, so after a Web Update an old .xlsc brings back the old version of your application.

Since your user data is in named ranges, we suggest one of these two approaches.

Option 1: Cell Values save mode with custom values (our recommendation)

Select "Save defined cell values only" on the Workbook Saving and Loading page. Your updated EXE then keeps your new workbook and VBA code, and only the user's values are restored from the .xlsce file.

Marked cells are saved by cell address, so a range that moves in a later release would be restored to the wrong place. Custom values avoid this, because you choose the key:

  • In XLSPadlock_SaveCustomValues, go through your named ranges and write each one with WriteCustomCellValue, using the range name as the ID.
  • In XLSPadlock_RestoreCustomValues, read each one with ReadCustomCellValue and write it back through ThisWorkbook.Names("TheName").RefersToRange.
Custom values are stored as text: convert numbers and dates when you read them back. For a list, join its values into one string, with a separator that cannot appear in the list. Example: https://www.xlspadlock.com/doc/programmatically-restore-save-custom-values-with-vba-code

Please compile with XLS Padlock 2026.3, which fixes several .xlsce loading problems.

Do not change the save mode lightly: in the release that changes it, existing save files are no longer loaded, and users start again from the original workbook. If your application is not widely distributed yet, this is the best moment to switch. Then keep this mode for the life of the application.

Option 2: stay in Full Save mode and add export and import macros

One macro copies your named ranges to a normal .xlsx file, and a macro in the new version reads them back. Here is the code to adapt: https://www.xlspadlock.com/doc/excel-vba-migrate-user-data-updates

Please keep in mind that:

  • The .xlsx file is not encrypted.
  • An .xlsc file contains its own VBA code, so the export macro is only available in save files made with a release that includes it.
  • If "Do not allow loading/saving other workbooks" is enabled, your macros need the SetOption method described on that page.
For a save file made before you added the macro, you can open it yourself with Decrypt Save File: https://www.xlspadlock.com/doc/opening-a-save-yourself-decrypt-saves

Moving to another computer

In both modes, the user can copy the save file to the new computer and open it there. The only exception is the Full Save option that locks save files to one computer, if you enabled it.
 
What you saw is the normal behavior of the Full Save mode. An .xlsc file is a complete snapshot of the workbook, including its sheets, formulas and VBA code. Loading it replaces the workbook embedded in the EXE, so after a Web Update an old .xlsc brings back the old version of your application.

Since your user data is in named ranges, we suggest one of these two approaches.

Option 1: Cell Values save mode with custom values (our recommendation)

Select "Save defined cell values only" on the Workbook Saving and Loading page. Your updated EXE then keeps your new workbook and VBA code, and only the user's values are restored from the .xlsce file.

Marked cells are saved by cell address, so a range that moves in a later release would be restored to the wrong place. Custom values avoid this, because you choose the key:

  • In XLSPadlock_SaveCustomValues, go through your named ranges and write each one with WriteCustomCellValue, using the range name as the ID.
  • In XLSPadlock_RestoreCustomValues, read each one with ReadCustomCellValue and write it back through ThisWorkbook.Names("TheName").RefersToRange.
Custom values are stored as text: convert numbers and dates when you read them back. For a list, join its values into one string, with a separator that cannot appear in the list. Example: https://www.xlspadlock.com/doc/programmatically-restore-save-custom-values-with-vba-code

Please compile with XLS Padlock 2026.3, which fixes several .xlsce loading problems.

Do not change the save mode lightly: in the release that changes it, existing save files are no longer loaded, and users start again from the original workbook. If your application is not widely distributed yet, this is the best moment to switch. Then keep this mode for the life of the application.

Option 2: stay in Full Save mode and add export and import macros

One macro copies your named ranges to a normal .xlsx file, and a macro in the new version reads them back. Here is the code to adapt: https://www.xlspadlock.com/doc/excel-vba-migrate-user-data-updates

Please keep in mind that:

  • The .xlsx file is not encrypted.
  • An .xlsc file contains its own VBA code, so the export macro is only available in save files made with a release that includes it.
  • If "Do not allow loading/saving other workbooks" is enabled, your macros need the SetOption method described on that page.
For a save file made before you added the macro, you can open it yourself with Decrypt Save File: https://www.xlspadlock.com/doc/opening-a-save-yourself-decrypt-saves

Moving to another computer

In both modes, the user can copy the save file to the new computer and open it there. The only exception is the Full Save option that locks save files to one computer, if you enabled it.
Thank you very much. I already had code in place that would export a JSON file with macros that handled the DDL expansion/contraction when users added or deleted items within those ranges thereby maintaining the integrity of those named ranges. During the Restore process one of the macros basically cleared the range's contents and reduced the number of rows to two then wrote the first item on the list in row one and with the additional items inserted a new row above the blank last row adding the items name to the new row until it adds the last item. I was able to use much of the existing code with some revisions per your Option 1 above. I am still working with XLS PadLock v2025.2 and reconsidering the switch to v2026 before I actually take this to production in the next few weeks. I may still continue with 2025.2 (+ WooCommerce Kit 2025) through the Beta process as I am still trying to wrap my mind around how the v2026 versions work.

Thanks again for your assistance.
 
Back
Top