+ Reply to Thread
Results 1 to 7 of 7

Prohibit Saving an Excel Files if Conditions not Completed

  1. #1
    Registered User
    Join Date
    03-18-2013
    Location
    medellin, colombia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Prohibit Saving an Excel Files if Conditions not Completed

    hello,
    I have an Excel 2003 file where I would like to forbid people to save it unless some particular cell have "0" (zero) as a value.

    with a msgBox that would say that those cells need to be at zero in order for them to be able to save the file.

    Looking around i found the Workbook_BeforeSave but do not really know how to use it : i have come so far to a code that look like this :

    Please Login or Register  to view this content.
    thanks everyone for your help

  2. #2
    Forum Contributor
    Join Date
    12-31-2012
    Location
    Jhang, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    250

    Re: Prohibit Saving an Excel Files if Conditions not Completed

    Please Login or Register  to view this content.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,086

    Re: Prohibit Saving an Excel Files if Conditions not Completed

    Maybe, something like:

    Please Login or Register  to view this content.

    Beware that a combination of positive and negative values in the range could result in a zero total ... and allow the workbook to be saved.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    03-18-2013
    Location
    medellin, colombia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Prohibit Saving an Excel Files if Conditions not Completed

    Thanks, i just added
    Please Login or Register  to view this content.
    in order to have it with the first sheet.

    Thanks a lot

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,086

    Re: Prohibit Saving an Excel Files if Conditions not Completed

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  6. #6
    Registered User
    Join Date
    03-18-2013
    Location
    medellin, colombia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Prohibit Saving an Excel Files if Conditions not Completed

    The Good Solution is the one from hafizimran

    Please Login or Register  to view this content.

    Thanks to you too TMShucks but your Solution was too complicated and as you underligned it yourself, it was a Sum of the Range so...
    But thank you very much for your quick answer.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,086

    Re: Prohibit Saving an Excel Files if Conditions not Completed

    You're welcome. It's always good to have choices and you learn from the different options presented.

    Glad you have a solution you like.

    Regards, TMS

+ 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