Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Expiring passwords | Excel Discussion (Misc queries) | |||
Is there a way to unload the loaded XLL file in Excel? Hi all, I amdebugging XLL link library using Visual C++. Everytime I rebuild the XLL, Ihave to close the whole Excel program and relaunch the Excel program again,and then load in the newly gene | Excel Discussion (Misc queries) | |||
Expiring/Killing Macro(s) | Excel Discussion (Misc queries) | |||
Expiring the Old Program on Particular date. Is it Possible? | Excel Programming | |||
Expiring | Excel Worksheet Functions |