Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Something Challenging

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Something Challenging

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Something Challenging

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Something Challenging

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Challenging Problem [email protected] Excel Discussion (Misc queries) 1 June 22nd 07 12:58 AM
Challenging Problem Naji Excel Discussion (Misc queries) 1 January 11th 06 05:05 PM
Here's a challenging question for you... CCAP Excel Discussion (Misc queries) 5 November 17th 05 01:03 PM
Challenging Charting C TO Charts and Charting in Excel 0 January 17th 05 06:57 PM
Challenging Formula in VB Bruce Roberson[_2_] Excel Programming 7 January 21st 04 12:28 PM


All times are GMT +1. The time now is 04:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"