Serving the Quantitative Finance Community

 
User avatar
Beachcomber
Topic Author
Posts: 2
Joined: May 25th, 2004, 5:56 pm

VBA coding question

October 28th, 2009, 2:54 pm

Hi,Does anybody know of a way to code a VBA program to become inoperable at a certain time in the future or after a certain number of runs?
 
User avatar
jpsnj
Posts: 0
Joined: February 12th, 2008, 2:42 pm

VBA coding question

October 28th, 2009, 4:47 pm

A routine in the open event like the code below will be effective with 99% of the users. Private Sub Workbook_Open() Dim i As Integer i = Val(GetSetting("MyApp", "MySection", "Counter", 0)) If i >= 5 Then ThisWorkbook.Saved = True ThisWorkbook.Close False Else i = i + 1 SaveSetting "MyApp", "MySection", "Counter", CStr(i) End If End Sub
 
User avatar
Beachcomber
Topic Author
Posts: 2
Joined: May 25th, 2004, 5:56 pm

VBA coding question

October 29th, 2009, 2:37 pm

Thank you.