+ Reply to Thread
Results 1 to 8 of 8

PrivateAfterSave

  1. #1
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    PrivateAfterSave

    Is there a way to do something after a document is saved but not closed? Probably not. And if not is there a way to make an action done during before save apply only to the workbook that invoked the code? IE recalculate turned off during before save but only for the workbook that turned it off...I have a workbook that brings this computer to its knees if it calculates when I don't want it to.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: PrivateAfterSave

    randell, you're speaking in tongues.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    Re: PrivateAfterSave

    Ok you know on the workbook section of the macro code on any given sheet how you have BeforeSave private function? Well I want something to happen after the save happens but only if the sheet wasn't closed (obviously can't change a sheet that is closed). If this is not possible then is there a way to disable calculation before save for an individual workbook? Instead of a global change applying to all workbooks?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: PrivateAfterSave

    Do anything you want in the BeforeSave event. Do anything else you want in the BeforeClose event.

  5. #5
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    Re: PrivateAfterSave

    I did that, but problem is what if I want to have both spreadsheets open? Is there a way to run a macro on a timer trigger? I could accomplish my goal if I set a macro to run after x seconds to turn it back on...

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: PrivateAfterSave

    Randell, do the snakes come out next?

    Consider a plain English explanation of what you want to do.

  7. #7
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    Re: PrivateAfterSave

    LOL all i'm trying to say is...after I turn off calculate before save during BeforeSave private sub...is there a way to add another macro that will run after say 30 seconds to go and turn calculate before save back on?

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: PrivateAfterSave

    Perhaps in the BeforeSave event,
    • Turn off CalculateBeforeSave
    • Cancel the save
    • Save the doc
    • Turn CalculateBeforeSave back on
    • Return
    Before you do that, you need to decide what should happen if the user is doing a SaveAs instead of Save.

+ 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