PDA

View Full Version : Solved: Delete all code after save



blackie42
01-08-2009, 07:56 AM
Hi

I have a workbook template with modules/forms etc

I'd like to force the user to save the workbook using a different name
and then delete the code (modules & forms). This is to make sure the saved filesize isn't too big.

I've seen some code that uses VBIDE but am too much of a novice to understand and am confused as to how to use it in this context.

Any help appreciated

thanks
Jon

lucas
01-08-2009, 08:10 AM
Hi Jon, I don't want to distract from your actual project but as an alternative why not put all the code in an addin so you can run it on any open workbook but it is not attached to that workbook in any way.

Check out Johnske's article on creating addins in the Articles section.

lucas
01-08-2009, 08:12 AM
Here's a kb entry by Jake that might help if the addin is not an option:

http://vbaexpress.com/kb/getarticle.php?kb_id=93

blackie42
01-09-2009, 01:57 AM
Thanks Lucas - the KB aticle works well.

regards

Jon