Auto_Open, Expiry Date of VBA application.

S

Shazi

Dear Sir,

I am using the below mentioned macro in my project, for Limit of my
VBA project for the certain time. (life time of this vba application).

it is working fine, but the problem is this, if I want to increase the
no. of days for one month or more, then I have to open VBA Editor and
then change the Date in Auto_Open Macro.

Is there any way to change the Expiry date of VBA program fdirectly
from the worksheet, not from VBA Editor.

Supose if I put the date in Sheet1, A1=15-Jul-2008, then it will
change in the auto_open macro automatically.

if any one have any suggession, pls send me.

Thank you for support in Advance. my code is given below

Shahzad zafar


Sub auto_open()

If Date > #7/15/2008# Then ' < Expiry date of vba program
MsgBox "RunTime"
ThisWorkbook.Close
End If

Application.DisplayFullScreen = True
Application.CommandBars("Worksheet Menu Bar").Enabled = False

' to open Login Screen
UserLogin.Show

Application.ScreenUpdating = False

' to protect all sheets with password
Dim n As Integer
For n = 1 To Worksheets.Count
'to protect WORKSHEETS
Worksheets(n).Protect Password:="marketing"
Next n
'to protect WORKBOOK
ActiveWorkbook.Protect Password:="marketing", Structure:=True,
Windows:=False

Application.ScreenUpdating = True

End Sub
 
D

Dave Peterson

You could use:

If Date > thisworkbook.worksheets("Sheet999").range("a1").value Then
 
R

Ron de Bruin

Hi Shazi


You can use 3 cells on a hidden worksheet or so with

2008
7
15

'Year,Month,Day
If Date > DateSerial(Sheets("Sheet1").Range("A1").Value, Sheets("Sheet1").Range("B1").Value, Sheets("Sheet1").Range("C1").Value)
Then
 
S

Shazi

You could use:

If Date > thisworkbook.worksheets("Sheet999").range("a1").value Then





















--

Dave Peterson- Hide quoted text -

- Show quoted text -



Hi, Mr. Dave,

I tried your code, it is working very good. you solved my big problem.
Thank you very much.

Now I can change the expiry date of my project from the worksheet at
any time.
Thank you once again.

Best Regards.

Shahzad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top