Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle File-Save differently in Development Edition #5

Closed
jimm-domingo opened this issue Jun 17, 2017 · 0 comments
Closed

Handle File-Save differently in Development Edition #5

jimm-domingo opened this issue Jun 17, 2017 · 0 comments
Labels

Comments

@jimm-domingo
Copy link
Contributor

jimm-domingo commented Jun 17, 2017

There's an issue with a developer accidentally saving the development edition of her toolkit add-in which uses this library. She can trigger the save in the VBE by clicking the Save icon or selecting File --> Save menu item. This is a natural behavior to regularly save one's work to disk.

The problem is that this action causes all the modules that were imported during the bootstrap process to be saved in the development edition. And that's problematic, because the next time the development edition is opened, it will attempt to import those modules again.

So the solution is to handle a Workbook_BeforeSave event handler in the toolkit add-in. This handler could do one of these:

  1. Ignore the event, by setting Cancel = True, so the add-in is not saved. But this is a not good option because the developer is expecting the add-in to be saved to disk, and her action is silently ignored without any feedback.
  2. Alternatively, display a message telling the developer that the add-in can't be saved, and that instead, she should use Developer Tools --> Export VBA Code menu item.
  3. Automatically call the Export VBA Code menu item.
  4. Provide a configuration setting that a developer can use to specify that a File-Save will cause either action 2 (display message) or action 3 (call vba-code export).
jimm-domingo pushed a commit that referenced this issue Aug 26, 2018
Added a private event handler for the toolkit's BeforeSave event.  This
handler checks a public boolean flag in the bootstrap module to see if
the current toolkit edition can be saved or not.  Saving is disabled by
default, and is only enabled when building the production edition, or
for the special NO-LOAD file name.  Fixes GH #5.
jimm-domingo pushed a commit that referenced this issue Aug 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant