Consulting

Results 1 to 7 of 7

Thread: Loosing new VBA functions when I quit Excel

  1. #1
    VBAX Regular
    Joined
    Jun 2004
    Location
    Los Angeles
    Posts
    22
    Location

    Loosing new VBA functions when I quit Excel

    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!

    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
    Last edited by Aussiebear; 04-29-2023 at 08:34 PM. Reason: Adjusted the font style

  2. #2
    VBAX Tutor jamescol's Avatar
    Joined
    May 2004
    Location
    Charlotte, NC
    Posts
    251
    Location
    After returning to XL, are you then saving the workbook?
    "All that's necessary for evil to triumph is for good men to do nothing."

  3. #3
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    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.

  4. #4
    VBAX Regular
    Joined
    Jun 2004
    Location
    Los Angeles
    Posts
    22
    Location
    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!

  5. #5
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Definitely. Post back if that works for you, so the readers will know for next time!

  6. #6
    VBAX Regular
    Joined
    Jun 2004
    Location
    Los Angeles
    Posts
    22
    Location
    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!
    Last edited by Aussiebear; 04-29-2023 at 08:35 PM. Reason: Adjusted the font style

  7. #7
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    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!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •