Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Date check for expiration

Hello,
I'd like to insert a simple protection into my Excel file. For example
I'd like to

-check the current DATE that file is opened
-if it is opened after a particular date the applications quits.

Ok, I now is very easy to unprotect but it's better that no protection
at all. (and I know
they can disable macro at start)

Something like this doesn't work:


Sub Apri_Open()

If Date Worksheets("foglio1").Range("A1") Then
MsgBox ("expired")
ThisWorkbook.Close
End If
End Sub

Because date() returns the time also.

Thanks,
Ale.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Date check for expiration

The Date method doesn't return the time. It returns only the Date. Time
returns only the Time, and Now returns both.

What's in foglio1!A1?



In article .com,
"A" wrote:

Hello,
I'd like to insert a simple protection into my Excel file. For example
I'd like to

-check the current DATE that file is opened
-if it is opened after a particular date the applications quits.

Ok, I now is very easy to unprotect but it's better that no protection
at all. (and I know
they can disable macro at start)

Something like this doesn't work:


Sub Apri_Open()

If Date Worksheets("foglio1").Range("A1") Then
MsgBox ("expired")
ThisWorkbook.Close
End If
End Sub

Because date() returns the time also.

Thanks,
Ale.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
encrypting MS document with expiration date Peter A[_2_] Excel Discussion (Misc queries) 1 June 18th 09 03:42 PM
Calculat an expiration date old coach Excel Worksheet Functions 0 February 23rd 09 03:55 AM
Expiration Date countdown Colin Hayes Excel Worksheet Functions 3 January 15th 09 01:23 PM
Expiration date on Macro Borg Excel Programming 4 August 1st 06 05:24 AM
Code For Expiration Date Juan[_3_] Excel Programming 2 October 25th 03 09:15 AM


All times are GMT +1. The time now is 04:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"