ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Expiring the Old program in Excel. (https://www.excelbanter.com/excel-programming/378192-expiring-old-program-excel.html)

Premanand Sethuraman

Expiring the Old program in Excel.
 
Dear All,
I'm making some programs (Excel with VBA) for Engineers use.
I will revise the program every 6 months and send it to my branch people
(Engineers)
The problem is even though I'm mentioing my revision every time in my
program, some time our people may forget and they are using the old version.
I'm asking them to delete the old version and use the latest but in vain.

I just want to ask one thing whether we can able to provide some expiry date
for that program (in the form of VB Coding) so that even though if the people
use the old version, it wil never open (or) activate. Hence people may aware
to use the latest version.
Is it Possible in EXCEL WITH VBA?
Please advise.
Regards,
Anand.

NickHK

Expiring the Old program in Excel.
 
You could may use something with BuiltinDocumentProperties and CreationDate
in the Workbook_Open and test if
< DateAdd("m", -6, Now())
Check the help for these terms.

NickHK

"Premanand Sethuraman" wrote
in message ...
Dear All,
I'm making some programs (Excel with VBA) for Engineers use.
I will revise the program every 6 months and send it to my branch people
(Engineers)
The problem is even though I'm mentioing my revision every time in my
program, some time our people may forget and they are using the old

version.
I'm asking them to delete the old version and use the latest but in vain.

I just want to ask one thing whether we can able to provide some expiry

date
for that program (in the form of VB Coding) so that even though if the

people
use the old version, it wil never open (or) activate. Hence people may

aware
to use the latest version.
Is it Possible in EXCEL WITH VBA?
Please advise.
Regards,
Anand.




Premanand Sethuraman

Expiring the Old program in Excel.
 
Dear Nick,
Thanks for your immediatel treply.
I tried this with "minutes" to expire but it is not working. I've given the
codings here

Private Sub Workbook_Open()
Dim dat As Date
dat = 27 / 11 / 2006
If dat DateAdd("m", 5, "27/11/2006") Then
MsgBox ("This program is expired. Please contact H.O for revised Program")
ActiveWorkbook.Close
Else
End If
End Sub

Please advise me how should I modify?
Regards,
Anand.


"NickHK" wrote:

You could may use something with BuiltinDocumentProperties and CreationDate
in the Workbook_Open and test if
< DateAdd("m", -6, Now())
Check the help for these terms.

NickHK

"Premanand Sethuraman" wrote
in message ...
Dear All,
I'm making some programs (Excel with VBA) for Engineers use.
I will revise the program every 6 months and send it to my branch people
(Engineers)
The problem is even though I'm mentioing my revision every time in my
program, some time our people may forget and they are using the old

version.
I'm asking them to delete the old version and use the latest but in vain.

I just want to ask one thing whether we can able to provide some expiry

date
for that program (in the form of VB Coding) so that even though if the

people
use the old version, it wil never open (or) activate. Hence people may

aware
to use the latest version.
Is it Possible in EXCEL WITH VBA?
Please advise.
Regards,
Anand.





NickHK

Expiring the Old program in Excel.
 
Try these.

- What value do you get for CLng(dat) ?
Does it = 0 ?
What is the value of 27 divided by 11 divided by 2007 ?

- Using a date literal in VBA, you need to enclose it in #..date..#
However, depending on the user's Short Date settings (dd/mm/yy v. mm/dd/yy),
this could yield the wrong date, although in this case it will not, as there
is no 27th month
To be clear use:
DateSerial(2007, 11, 27)

- "m" means months, not minutes. That is "n". Check the help for DateAdd.

-Your logic on the date comparison is wrong. Assuming a 6 month expiration
date, you something like :
dat=dateSerial(2007,4,27)
If DateAdd("m", 6, dat) < Now() Then

NickHK

"Premanand Sethuraman" wrote
in message ...
Dear Nick,
Thanks for your immediatel treply.
I tried this with "minutes" to expire but it is not working. I've given

the
codings here

Private Sub Workbook_Open()
Dim dat As Date
dat = 27 / 11 / 2006
If dat DateAdd("m", 5, "27/11/2006") Then
MsgBox ("This program is expired. Please contact H.O for revised Program")
ActiveWorkbook.Close
Else
End If
End Sub

Please advise me how should I modify?
Regards,
Anand.


"NickHK" wrote:

You could may use something with BuiltinDocumentProperties and

CreationDate
in the Workbook_Open and test if
< DateAdd("m", -6, Now())
Check the help for these terms.

NickHK

"Premanand Sethuraman"

wrote
in message ...
Dear All,
I'm making some programs (Excel with VBA) for Engineers use.
I will revise the program every 6 months and send it to my branch

people
(Engineers)
The problem is even though I'm mentioing my revision every time in my
program, some time our people may forget and they are using the old

version.
I'm asking them to delete the old version and use the latest but in

vain.

I just want to ask one thing whether we can able to provide some

expiry
date
for that program (in the form of VB Coding) so that even though if the

people
use the old version, it wil never open (or) activate. Hence people may

aware
to use the latest version.
Is it Possible in EXCEL WITH VBA?
Please advise.
Regards,
Anand.








All times are GMT +1. The time now is 03:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com