+ Reply to Thread
Results 1 to 7 of 7

Expiration Date on Macro

  1. #1
    Forum Contributor
    Join Date
    11-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    200

    Expiration Date on Macro

    I am using the following code to put an expiration date on a macro but I want it to automatically close the file without saving it when they hit the OK button for the message box. With this, you can "cancel" the save and it will bypass it. What changes do I need to make? Thanks.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Expiration Date on Macro

    Hi, backyardfun,

    you should not consider that change to make the application failsafe.

    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Expiration Date on Macro

    have you tried something like
    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  4. #4
    Forum Contributor
    Join Date
    11-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    200

    Re: Expiration Date on Macro

    I am not putting it in an auto-open macro, so that will be ok right?

  5. #5
    Forum Contributor
    Join Date
    11-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    200

    Re: Expiration Date on Macro

    The False addition worked, thank you. This is the code with the rest of it. Is there a way to make the "days left" part show only when it gets within 7 days of the expiration date?


    Please Login or Register  to view this content.

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Expiration Date on Macro

    Hi, backyardfun,

    Stop should not be the name of a procedure as it is a VBA command.

    And how will you start the procedure if not via Auto_Open/Workbook_Open?

    Please Login or Register  to view this content.
    Ciao,
    Holger

  7. #7
    Forum Contributor
    Join Date
    11-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    200

    Re: Expiration Date on Macro

    My bad, I just used the name stop as a dummy name. It is not a macro by itself, so I should not have even used the sub, end sub lines. This code is placed (without the sub, end sub) in the beginning of the most important macro in the worksheet. The file will be able to be opened and navigated around until this macro is ran. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Storage and Expiration Date Macro Troubles
    By cobalt87 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-04-2013, 03:26 PM
  2. Auto_open macro using an "expiration date" to disable the spreadsheet
    By thl in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-13-2008, 06:51 PM
  3. set expiration date
    By nhat8121 in forum Excel General
    Replies: 13
    Last Post: 01-05-2007, 10:02 PM
  4. Expiration date on Macro
    By Borg in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-01-2006, 12:24 AM

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