PDA

View Full Version : Solved: loosing new VBA functions when I quit Excel



Blakieto
07-08-2004, 04:42 PM
I've ended up making a text file backup of my Excel VBA work, because 95% of the time I quit Excel, the routines I've been working on (only the new ones) are gone when I relaunch Excel! :eek:

The routines are within two code modules of an addin project. One module for the "Finance" logic and another module for the "Excel programming" logic...

Basically, I'm just working on logic (email sending and generating messages from cell values.) When it is time to quit, I make sure to run the "Debug->Compile XXX" pull down menu, and then I do the "File->Close and return to Microsoft Excel" pull down menu.

Seems pretty basic... what am I missing here?

-Blakieto

jamescol
07-08-2004, 05:02 PM
After returning to XL, are you then saving the workbook?

Zack Barresse
07-08-2004, 05:05 PM
If it's an XLA, you'll need to save it before you close it, you won't get prompted to save an add-in file.

Blakieto
07-08-2004, 05:12 PM
I've gotten into the habit of saving the .xls file... (not that that seemed to help) But now that Zack mentioned it, I have not been doing the "File->Save xxx.xla" pull down menu. I'll start doing that and see if it fixes things.

Thanks James and Zack!

Zack Barresse
07-08-2004, 06:37 PM
Definitely. Post back if that works for you, so the readers will know for next time! :)

Blakieto
07-09-2004, 10:44 AM
Zack,

Yep, that seems to have been it. Seems mighty weak that a development environment does not prompt one about unsaved work before closing. But that seems to be the case. I just need to make sure that I do the "File->save pluginName.xla" pulldown menu before quitting.

So strange- I've been writing code for over 20 years, and this is the first environment I've seen that lets someone quit without asking them if they want their work saved. Oh well...

Thanks!

Zack Barresse
07-09-2004, 10:56 AM
I'm glad it helped! I know that from losing some work myself. I lost it 3 times before I figured that out! And it's just with Add-ins too. Regular workbooks, even your Personal.xls will prompt you. That's because they have a workbook. VBA is all background and integrated into Excel, not a seperate program. I *think* that's why there's not a prompt to save when exiting the VBE.

But glad you got it sorted!! :)