+ Reply to Thread
Results 1 to 6 of 6

Workbook_AfterSave()

  1. #1
    Registered User
    Join Date
    01-29-2007
    Posts
    92

    Workbook_AfterSave()

    I do not want my sheet to update changes when i saveas the sheet. However, any other time i want the sheet to update automatically.

    I know how to set calculating to manual using

    Please Login or Register  to view this content.
    I insert this code into the sub workbook_beforeSave() but my problem is that after the sheet saves, i need to turn it back to

    Please Login or Register  to view this content.
    How can i do this? is there a built in sub that triggers after the workbook is saved?

    Thanks
    Schwizer

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    You can include it in the Workbook BeforeClose event.

  3. #3
    Registered User
    Join Date
    01-29-2007
    Posts
    92
    I have tried that but my problem comes when the user selects saveas and then keeps working. In that case, the calculations stay manual and things don't update properly. I could force the workbook to close but i was hoping for another solution.

  4. #4
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    In that case, you could use the automatic statement in the Workbook Deactivate event, and manual in the Workbook Activate event.

  5. #5
    Registered User
    Join Date
    01-29-2007
    Posts
    92
    Thank you for all the help so far. I've attached a sample sheet that i made up although it uses the same principle.

    How to use sheet:
    1. Select a country. (this modifies the listfillrange of the next combobox to show only the cities of that country and it clears the value of combobox2 since the country has been changed.
    2. Select a city.
    3. Save as the file (make sure visual basic editor is turned off)
    4. After save as note that combobox2 entry is blank because the code of combobox1 was triggered. I'm looking for a way to save as the file without the code triggering.
    The problem with turning calculation to manual is that as soon as its turned back to automatic it does a full calculation of the sheet which triggers the code anyway.

    I'm desperate
    Thanks
    Bruno

  6. #6
    Registered User
    Join Date
    01-29-2007
    Posts
    92
    here's the attachment
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1