• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

vba code to bind datepicker to date

Claudiuss

New Member
Hello everyone.
Please, I have an xlsm file in which there is an expiration date.
Suppose the expiration date is 02/22/2023.
And today's date, calendar date that is on user's pc is 02/21/2023
My concern is that the user, seeing that he only has one day left to use the file, can change today's date to 10/02/2023 for example, so he can still use the file more than he should.

How to do?
The idea that came to me is to insert the date picker

So here is the code

>>> Moved to VBA Macros <<<
>>> use code - tags <<<

Code:
Private Sub Workbook_Open()
Dim expirationdate As Date
expirationdate = "02/22/2023"
If Date < expirationdate Then
Frmcode.Show
my concern is the modification of today's date which is the date of the user's PC.
 

Attachments

  • Clipboard01.jpg
    Clipboard01.jpg
    47.1 KB · Views: 2
Last edited by a moderator:
Hello. How to do what exactly ?!​
If the system date is changed so the date picker returns obviously the same date !​
So you did not even give it a try, test it and see !​
An indirect workaround may be first to check if there is a web connexion then read the date on a specific web server.​
But as any VBA procedure can be easily bypassed, just changing the expiration date in a snap, so easy …​
 
Back
Top