Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ello
This is gonna sound abit strange but wonderin if there is some sort o code to make my VBA destroy it's self (or at least criple) after bein run x amount of times. the story is i've finished my little project work and have got to pass it on so the cheese's can approve it but dont exactly trust them not to distribute it and give me nothin 4 m time/effort. i need the VBA to run say 10 times so the right people ca see it but then cripple it's self so they have to sort me out 2 make i continue to work. I've already taken evey possible precautio passworded etc so they cant mess with the code/sheets. please help me out, i'll be very happ -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Well, unfortunately, Excel isn't real secure, but you could try this. Put a
1 in any cell, even on its own hidden sheet. Put, in the workbook open event, code to add 1 to the value of that cell. Also an IF that if the value of that cell is 11, to just throw up a message box that says "you let it expire, you dork", and closes the file. But what happens if they don't enable macros? You'd better make sure you throw up a blank worksheet (or one that tells them to enable macros) when the workbook opens without macros... <-*-<-*-<-*-<-*-<-*-<-*-<-*-<-*- Hope this helps! Anne Troy (better known as Dreamboat) Author: Dreamboat on Word Email: Dreamboat*at*Piersontech.com Web: www.TheOfficeExperts.com <-*-<-*-<-*-<-*-<-*-<-*-<-*-<-*- "Swift2003 " wrote in message ... ello This is gonna sound abit strange but wonderin if there is some sort of code to make my VBA destroy it's self (or at least criple) after being run x amount of times. the story is i've finished my little project 4 work and have got to pass it on so the cheese's can approve it but i dont exactly trust them not to distribute it and give me nothin 4 my time/effort. i need the VBA to run say 10 times so the right people can see it but then cripple it's self so they have to sort me out 2 make it continue to work. I've already taken evey possible precaution passworded etc so they cant mess with the code/sheets. please help me out, i'll be very happy --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanks, sounds good although i not sure of coding but still, as leas
i've got the jist of what to aim -- Message posted from http://www.ExcelForum.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Swift2003, I got this code from this ng, but I can't remember who actually
provided it (appologies), anyway, could be adapted to do what you want... Option Explicit Private Sub Workbook_Open() 'Public should be private when doing this for real Dim myCutOff As Long myCutOff = DateSerial(2002, 10, 6) If Date myCutOff Then MsgBox "I'm sorry, this workbook should have expired on: " _ & Format(myCutOff, "mm/dd/yyyy") & vbLf & _ "After you dismiss this box, this program will pause for: " _ & CLng(Date) - myCutOff & " seconds!" & vbLf & vbLf & _ "One second for each day past expiration!" Application.Wait TimeSerial(Hour(Now), Minute(Now), _ Second(Now) + CLng(Date) - myCutOff) End If End Sub Thsi one actually deletes a selected module(s), adjust to suit... Sub test() MsgBox "place your code here" With ThisWorkbook.VBProject.VBComponents .Remove .Item("Module1") End With End Sub and finally this code closes the wb without saving any changes then quits excel itself... Option Explicit Dim WB As Workbook Sub RunCloseMe() 'adjust time and or date Application.OnTime Now + TimeValue("00:00:20"), Procedu="CloseMe" End Sub Sub CloseMe() Set WB = ActiveWorkbook Application.DisplayAlerts = False WB.Save With Application .DisplayAlerts = True .Quit End With End Sub hope these help... seeya ste |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Challenging Problem | Excel Discussion (Misc queries) | |||
Challenging Problem | Excel Discussion (Misc queries) | |||
Here's a challenging question for you... | Excel Discussion (Misc queries) | |||
Challenging Charting | Charts and Charting in Excel | |||
Challenging Formula in VB | Excel Programming |