Time Trial for Excel Sheets

torque

New Member
Joined
Apr 15, 2004
Messages
20
Is there a way to make an Excel sheet expire (ie. become useless or password protected) after a certain number of uses or days?

thanks!
 
I found this and it works well... You do need to check the 'allow access to visual basic projects' in the workbook macro security settings. Otherwise...slick as a whistle


Sub DeleteModule()

Dim x As Object

Set x = Application.VBE.ActiveVBProject.VBComponents

' Delete the current module.
x.Remove VBComponent:=x.Item("Module1")

End Sub

This came from the microsoft web site...

Thanks again for all your help!!!
 
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
So what is the easiest (for a newbie) way to just delete the file after a certian date? Keep in mind that I don't know the exact location of the file on their computer. So using the kill command like this (Kill "C:\Documents and Settings\My Documents\TheWorkbooksRealName.xls") does me no good.

Is there a way to make the kill command just kill the file itself wothout knowing the exact directory path?
 
Upvote 0
You can very easily know the file path.

ThisWorkbook.Path

will tell you what the path of the file is.

ThisWorkbook.fullname will return the whole path and file name.

Before you can kill the file, you have to save the current one as something else or else it denies permission to the file. So...you can save the file where ever you want and delete the one.

I'm actually trying to do something similar, but removing the code in modules is difficult because the default security is to prevent things from being done to the vba code. So...I'm trying to find the best answer too. I had written a long post and it didn't post...and i haven't wanted to rewrite the thing. So...I'm hoping someone will post a good answer. Hope that helps a little...

Dave
 
Upvote 0
Hi, I am fairly new to programming, VB etc. so perhaps this is not the best place this ask this question, but hey.. I read and tried the time trial code that Stromma posted on June 9 and it works (rally cool!) Is there a way to insert some sort of user limit (before registration) using dates instead of the number of times a workbook is opened?

Rgrds.
 
Upvote 0

Forum statistics

Threads
1,216,446
Messages
6,130,699
Members
449,586
Latest member
spg5150

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top