+ Reply to Thread
Results 1 to 2 of 2

VBA to do selective saving

  1. #1
    Registered User
    Join Date
    07-23-2011
    Location
    Chennai,India
    MS-Off Ver
    Excel 2007
    Posts
    2

    VBA to do selective saving

    We've an input sheet with macros that validate the inputs before user saves the document.
    To make macros mandatory, i have included events during open and close of the workbook-standard method i guess.

    These are the lines in the 'workbook before close' event.
    This will hide all the sheets except "Enable Macros" so that the next time user opens the doc, evey other sheet will be hidden unless he enables macros (which triggers another event making the other sheets visible)

    Please Login or Register  to view this content.
    But the problem is that, excel generates a challenge box "do you want to save changes?" because the above lines involve hiding sheets. If user clicks No, there would be no use in the above event.

    So i would like to find a way to save only this 'hiding the sheets part' when the user tries to close the doc even if he clicks "No" in the above challenge box. If Yes is clicked, all changes are to be saved including the hiding part.

    The actual requirement is that, irrespective of whether or not user wishes to save the changes he has done after the last save, system should save the "hiding the sheets" part.

    Any ideas?

  2. #2
    Registered User
    Join Date
    07-23-2011
    Location
    Chennai,India
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: VBA to do selective saving

    if there is a method to discard changes from the last save till now, that would be a great way to handle the scenario where user clicks No in the challenge box.
    The macro can then proceed with hiding the sheets and saving the workbook as all the other changes have been discarded.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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