+ Reply to Thread
Results 1 to 13 of 13

Set expiry date for macros?

  1. #1
    Registered User
    Join Date
    07-08-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    8

    Thumbs up Set expiry date for macros?

    Hi All!

    Greetings!

    I have an Excel workbook which contains some macros.

    Those macros should be able to run until 1st November 2010 (or some date). After that, when we try to run any macro, it should display some customized message! If I need, the date have to be changed within the code.

    Is it possible? Please HELP!!!

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Is it possible to set expiry date for macros?

    hi AlexandarRamaiyan
    some thing like....
    Please Login or Register  to view this content.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Is it possible to set expiry date for macros?

    Or perhaps something like this.

    Please Login or Register  to view this content.
    Name the modul with the "forbidden" macro "My_macro"

    You may have to set a referense to “Microsoft Visual Basic for Applications Extensibility"
    Tools -> Macro -> Visual Basic Editor -> Tools -> References

    If there is a problem with access to VBA project see this link. http://support.microsoft.com/kb/282830

    This macro removes the module with the "expired macro" and then saves the file so it replaces your original file.

  4. #4
    Registered User
    Join Date
    07-08-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Is it possible to set expiry date for macros?

    Thanks a lot!!!

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Is it possible to set expiry date for macros?

    Or
    Please Login or Register  to view this content.

  6. #6
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Is it possible to set expiry date for macros?

    Hi snb,

    Did you test your macro? When I run it I get the error message "compiler error: Type mismatch"

  7. #7
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Is it possible to set expiry date for macros?

    no big deal:
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    07-08-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    8

    Smile Re: Is it possible to set expiry date for macros?

    Quote Originally Posted by snb View Post
    no big deal:
    Please Login or Register  to view this content.
    Thanks a lot to all! It works fine!

  9. #9
    Registered User
    Join Date
    05-14-2013
    Location
    Dubai
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Is it possible to set expiry date for macros?

    Quote Originally Posted by snb View Post
    Or
    Please Login or Register  to view this content.
    I came here in search of a macro that will set an expiry (or some tricks to disable) for macro.
    I use this code it worked. However when I read it I thought it would delete the macro and when I reopen the file it wouldn't be there or won't work. When I reopen the file it's still there and when I changed the system time it is still working. How can we make a macro that will not work even if you change your system time?


    Thank you.

  10. #10
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Set expiry date for macros?

    excelcraze,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  11. #11
    Registered User
    Join Date
    05-14-2013
    Location
    Dubai
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Set expiry date for macros?

    I am sorry if i break your forum rules if any. However, when I googled for an expiry macro I got this link and that's how I am here which I clearly mentioned in my post. I thought I got what I came here for, and the same didn't work how I thought I would, so I thought I better ask in the same thread where I could get reply from same person who provided that macro rather than creating a new thread and ask others. Am I wrong dear admin?

  12. #12
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Set expiry date for macros?

    This thread is about 3 yrs old and its not likely the users will come back to an old thread. However, if you open a new thread, you can get faster replies. Hence, i asked you to open a new thread for your question.

  13. #13
    Registered User
    Join Date
    05-14-2013
    Location
    Dubai
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Set expiry date for macros?

    Ah I like that reply . Anyway to my question (macro for expiry date) I now have an idea and I think it should work perfectly. Let me try it tomorrow at office. If it's not I will start a new thread.

    Thank you

+ 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