PC Review


Reply
Thread Tools Rate Thread

Auto_Open, Expiry Date of VBA application.

 
 
Shazi
Guest
Posts: n/a
 
      9th Jun 2008
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
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      9th Jun 2008
You could use:

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



Shazi wrote:
>
> 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


--

Dave Peterson
 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      9th Jun 2008
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

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shazi" <(E-Mail Removed)> wrote in message news:19d899d5-21f7-4b9e-af4a-(E-Mail Removed)...
> 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


 
Reply With Quote
 
Shazi
Guest
Posts: n/a
 
      11th Jun 2008
On Jun 9, 7:58*pm, Dave Peterson <peter...@verizonXSPAM.net> wrote:
> You could use:
>
> If Date > thisworkbook.worksheets("Sheet999").range("a1").value Then
>
>
>
>
>
> Shazi wrote:
>
> > 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

>
> --
>
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application.Quit not funtioning in Sub Auto_open BenR Microsoft Powerpoint 1 29th Sep 2008 05:43 PM
auto_open problem for Expiry date shahzad4u_ksa@yahoo.com Microsoft Excel Programming 1 24th Apr 2008 03:36 PM
Auto_Open & Application.Quit - Now I can't get back into my macro Astello Microsoft Excel Programming 4 10th Oct 2006 07:29 PM
Expiry Date Checking Mishap with Specific Date Regional Settings Orlin Pavlov Anti-Spyware Installation 1 18th Mar 2005 07:02 PM
Auto_open & Application.ontime in shared files Jan Grinwis Microsoft Excel Programming 0 17th Oct 2004 05:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:36 AM.