banner



How To Set Expiration Date In Excel 2010

Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Expiration Date for Excel Programs.

Expiration Date for Excel Programs

Excel provides a robust development environment of which many people take full advantage. In fact, many people have written entire application programs using VBA with Excel as the framework.

If you do program development in Excel, you may be wondering if there is a way to write your program so that it will no longer work after a specific date. Fortunately, this is rather easy. One solution is to use something like the following as an Auto_Open macro:

Sub Auto_Open()     Dim exdate As Date     exdate = "12/31/2020"     If Date > exdate Then         MsgBox ("You have reached end of your trial period")         ActiveWorkbook.Close     End If     MsgBox ("You have " & exdate - Date & "Days left") End Sub        

If the date on the system running the program is greater than the date specified in the exdate variable, the user will see a message box indicating that their trial period has expired. When the user clicks on the OK button, the workbook closes. If the trial period is not over, then the message box indicates how many days are left in the period.

Of course, if you put a macro such as this in your application, it may stop you from opening the workbook to make program changes. The obvious way around this, of course, is to hold down the Shift key as you open the workbook. Doing so stops the Auto_Open macro from running. If your users know this, they can bypass the expiration check just as easily as you, however. The solution is to place similar checks within other macros that cannot be bypassed and that are essential to your program.

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10230) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. You can find a version of this tip for the older menu interface of Excel here: Expiration Date for Excel Programs.

Author Bio

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. Learn more about Allen...

MORE FROM ALLEN

Changing the Orientation of Your Chart

Microsoft Graph is a great way to add simple charts to your documents. Once you've got a graph added, you might want to ...

Discover More

Condensing Multiple Worksheets Into One

Want a quick way to combine your worksheets? Excel provides a tool to make the task easier, but you could also bypass the ...

Discover More

Magnifying Only the Current Cell

You can use the Zoom feature of Excel to magnify what Excel shows of your workbook, but it affects the entire screen. ...

Discover More

How To Set Expiration Date In Excel 2010

Source: https://excelribbon.tips.net/T010230_Expiration_Date_for_Excel_Programs.html

Posted by: estradabeemeart.blogspot.com

0 Response to "How To Set Expiration Date In Excel 2010"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel