I was testing out some code to to automate a SAVE AS routine via the RibbonCallbacks.
After making some changes and recompiling the exe file I found the changes appeared not to be working. However I then accidentally discovered that when I re-opened the application using the original workbook (as opposed to the last save) the code changes were indeed working.
Is this the expected behaviour? Happy to concede I may have got something wrong in the numerous code changes and re-compiles in an attempt to get it to work but that was my observation.
At the moment my Save routine (via code) saves to the original file name and the SAVE As saves to the original name appended with a timestamp. A subsequent Save (i.e. after a SAVE As) reverts back to the original filename – which is what I was hoping for but was not actually expecting.
Any clarification would be appreciated. Thank you,
EDIT: Last Save definitely not picking up on subsequent recompiles.
I think you hit the problem due to the “Full Save” mode as explained in the doc:
“Original workbook” will always show the latest workbook you compiled.
In Full Workbook Save Mode, loading a previously saved workbook will not merge the modified original workbook with changes of the end user. See the doc for the reasons and workarounds.
I am sure I never fully understood s9.1 of the manual. It explains that you can save either full .xlsc or defined cells .xlsce and then gives full examples of the latter but omits any detail on the former. I can see that the defined cells may be a workaround but not the explanation of the reason as to why the full version cannot be used.
What I am now finding confusing is that, if I have understood, if you make a new compile and then open an .xlsc file saved under the previous compile then the new exe code is forgotten and the old code remembered. Clever(?)
By way of example then if I deploy a secured workbook (as exe) and then either want to fix a bug or add some new functionality (to clarify: no changes made to underlying cells) – how must the file be compiled – as full or only ever as defined cells? Or can it depend upon something else?
If the defined cells method is to be used then is it possible to save all table ranges. All my data will be stored in tables but s9.1.1 is silent on tables. Presumably the cells to save/restore would only be the cells the user is responsible for i.e. data input cells?
Lastly, in regard to s9.4 [Opening a save yourself – decrypt saves] must the .xlsc or .xlsce be opened with the exact version of the .xlsm workbook that was used to create it, or can it be used with a more upto date version.
[Also 16.3 Saving without prompt refers to a procedure in 9.1 which (the procedure) doesn’t exist.]