Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 304
Default Macro to expire after a specified date

Sir,
I want to use your "Time Bomb" VB code, but I have question on the "Defined
Name". What name is it that we are to remove from the VB code?
Thanks

"Chip Pearson" wrote:

You could adapt the code on my "Timebombing A Workbook" page at
www.cpearson.com/Excel/WorkbookTimeBomb.aspx . Note that no VBA-based
protection scheme is foolproof. An experienced (and dishonest) user can work
around any protection you provide. However, code such as is on the page
referenced above is "good enough" for the vast majority of users.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"Dileep Chandran" wrote in message
oups.com...
Hello Masters,

How can I program a macro so that it expires after Jan 01, 2008. Any
help is greatly appreciated.

Thanks
-DC



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Macro to expire after a specified date

Specifically what piece of code are you referring to? The web page provides
several different methods of time bombing a workbook. The first one
described on the page uses a defined name called "ExpirationDate" that
contains the data after which the workbook is unusable. If you want to
remove the time bombing, you should delete that name. Of course, then next
time you open the workbook the name will be recreated. To permanently remove
the time bomb, you need to delete the VBA code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"pgarcia" wrote in message
...
Sir,
I want to use your "Time Bomb" VB code, but I have question on the
"Defined
Name". What name is it that we are to remove from the VB code?
Thanks

"Chip Pearson" wrote:

You could adapt the code on my "Timebombing A Workbook" page at
www.cpearson.com/Excel/WorkbookTimeBomb.aspx . Note that no VBA-based
protection scheme is foolproof. An experienced (and dishonest) user can
work
around any protection you provide. However, code such as is on the page
referenced above is "good enough" for the vast majority of users.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"Dileep Chandran" wrote in message
oups.com...
Hello Masters,

How can I program a macro so that it expires after Jan 01, 2008. Any
help is greatly appreciated.

Thanks
-DC




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 304
Default Macro to expire after a specified date

Thanks, also, do you put this in the "This Workbook" or it's module?

Option Explicit

Private Const C_NUM_DAYS_UNTIL_EXPIRATION = 90

Sub TimeBombWithDefinedName()
Dim ExpirationDate As String
Dim NameExists As Boolean

On Error Resume Next
ExpirationDate = Mid(ThisWorkbook.Names("ExpirationDate").Value, 2)
If Err.Number < 0 Then
NameExists = False
ExpirationDate = CStr(DateSerial(Year(Now), _
Month(Now), Day(Now) + C_NUM_DAYS_UNTIL_EXPIRATION))
ThisWorkbook.Names.Add Name:="ExpirationDate", _
RefersTo:=Format(ExpirationDate, "short date"), _
Visible:=False
Else
NameExists = True
End If

If CDate(Now) CDate(ExpirationDate) Then
MsgBox "This workbook trial period has expired.", vbOKOnly
ThisWorkbook.Close savechanges:=False
End If

End Sub

"Chip Pearson" wrote:

Specifically what piece of code are you referring to? The web page provides
several different methods of time bombing a workbook. The first one
described on the page uses a defined name called "ExpirationDate" that
contains the data after which the workbook is unusable. If you want to
remove the time bombing, you should delete that name. Of course, then next
time you open the workbook the name will be recreated. To permanently remove
the time bomb, you need to delete the VBA code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"pgarcia" wrote in message
...
Sir,
I want to use your "Time Bomb" VB code, but I have question on the
"Defined
Name". What name is it that we are to remove from the VB code?
Thanks

"Chip Pearson" wrote:

You could adapt the code on my "Timebombing A Workbook" page at
www.cpearson.com/Excel/WorkbookTimeBomb.aspx . Note that no VBA-based
protection scheme is foolproof. An experienced (and dishonest) user can
work
around any protection you provide. However, code such as is on the page
referenced above is "good enough" for the vast majority of users.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"Dileep Chandran" wrote in message
oups.com...
Hello Masters,

How can I program a macro so that it expires after Jan 01, 2008. Any
help is greatly appreciated.

Thanks
-DC




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 304
Default Macro to expire after a specified date

Sorry to bother you, but did you reply to my last post?

"Chip Pearson" wrote:

Specifically what piece of code are you referring to? The web page provides
several different methods of time bombing a workbook. The first one
described on the page uses a defined name called "ExpirationDate" that
contains the data after which the workbook is unusable. If you want to
remove the time bombing, you should delete that name. Of course, then next
time you open the workbook the name will be recreated. To permanently remove
the time bomb, you need to delete the VBA code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"pgarcia" wrote in message
...
Sir,
I want to use your "Time Bomb" VB code, but I have question on the
"Defined
Name". What name is it that we are to remove from the VB code?
Thanks

"Chip Pearson" wrote:

You could adapt the code on my "Timebombing A Workbook" page at
www.cpearson.com/Excel/WorkbookTimeBomb.aspx . Note that no VBA-based
protection scheme is foolproof. An experienced (and dishonest) user can
work
around any protection you provide. However, code such as is on the page
referenced above is "good enough" for the vast majority of users.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"Dileep Chandran" wrote in message
oups.com...
Hello Masters,

How can I program a macro so that it expires after Jan 01, 2008. Any
help is greatly appreciated.

Thanks
-DC




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Macro to expire after a specified date

I don't recall if I read it or not.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"pgarcia" wrote in message
...
Sorry to bother you, but did you reply to my last post?

"Chip Pearson" wrote:

Specifically what piece of code are you referring to? The web page
provides
several different methods of time bombing a workbook. The first one
described on the page uses a defined name called "ExpirationDate" that
contains the data after which the workbook is unusable. If you want to
remove the time bombing, you should delete that name. Of course, then
next
time you open the workbook the name will be recreated. To permanently
remove
the time bomb, you need to delete the VBA code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"pgarcia" wrote in message
...
Sir,
I want to use your "Time Bomb" VB code, but I have question on the
"Defined
Name". What name is it that we are to remove from the VB code?
Thanks

"Chip Pearson" wrote:

You could adapt the code on my "Timebombing A Workbook" page at
www.cpearson.com/Excel/WorkbookTimeBomb.aspx . Note that no VBA-based
protection scheme is foolproof. An experienced (and dishonest) user
can
work
around any protection you provide. However, code such as is on the
page
referenced above is "good enough" for the vast majority of users.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"Dileep Chandran" wrote in message
oups.com...
Hello Masters,

How can I program a macro so that it expires after Jan 01, 2008. Any
help is greatly appreciated.

Thanks
-DC







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Macro to expire after a specified date

Chip,

Is the same approach used when a "commercial" add-in requieres registration
after a trial period, do you know how it would work?

Do you have any literature on it?

Thanks

"Chip Pearson" wrote:

I don't recall if I read it or not.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"pgarcia" wrote in message
...
Sorry to bother you, but did you reply to my last post?

"Chip Pearson" wrote:

Specifically what piece of code are you referring to? The web page
provides
several different methods of time bombing a workbook. The first one
described on the page uses a defined name called "ExpirationDate" that
contains the data after which the workbook is unusable. If you want to
remove the time bombing, you should delete that name. Of course, then
next
time you open the workbook the name will be recreated. To permanently
remove
the time bomb, you need to delete the VBA code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"pgarcia" wrote in message
...
Sir,
I want to use your "Time Bomb" VB code, but I have question on the
"Defined
Name". What name is it that we are to remove from the VB code?
Thanks

"Chip Pearson" wrote:

You could adapt the code on my "Timebombing A Workbook" page at
www.cpearson.com/Excel/WorkbookTimeBomb.aspx . Note that no VBA-based
protection scheme is foolproof. An experienced (and dishonest) user
can
work
around any protection you provide. However, code such as is on the
page
referenced above is "good enough" for the vast majority of users.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"Dileep Chandran" wrote in message
oups.com...
Hello Masters,

How can I program a macro so that it expires after Jan 01, 2008. Any
help is greatly appreciated.

Thanks
-DC





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Macro to expire after a specified date

Hi Chip,

Your code is great, but I seem to have encountered a problem. The code
creates the "ExpirationDate" fine on one machines with the value being the
date e.g. 39555, whilst on a different machine it is being captured as a text
e.g. "18-03-08".

I have changed the the visibility to true so that i could see the value.

ThisWorkbook.Names.Add Name:="ExpirationDate", _
RefersTo:=Format(ExpirationDate, "short date"), _
Visible:=True

I have checked all the settings in excel but could find no differences on
either machines.

Do you have any idea?

Thanks

"Chip Pearson" wrote:

I don't recall if I read it or not.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"pgarcia" wrote in message
...
Sorry to bother you, but did you reply to my last post?

"Chip Pearson" wrote:

Specifically what piece of code are you referring to? The web page
provides
several different methods of time bombing a workbook. The first one
described on the page uses a defined name called "ExpirationDate" that
contains the data after which the workbook is unusable. If you want to
remove the time bombing, you should delete that name. Of course, then
next
time you open the workbook the name will be recreated. To permanently
remove
the time bomb, you need to delete the VBA code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"pgarcia" wrote in message
...
Sir,
I want to use your "Time Bomb" VB code, but I have question on the
"Defined
Name". What name is it that we are to remove from the VB code?
Thanks

"Chip Pearson" wrote:

You could adapt the code on my "Timebombing A Workbook" page at
www.cpearson.com/Excel/WorkbookTimeBomb.aspx . Note that no VBA-based
protection scheme is foolproof. An experienced (and dishonest) user
can
work
around any protection you provide. However, code such as is on the
page
referenced above is "good enough" for the vast majority of users.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"Dileep Chandran" wrote in message
oups.com...
Hello Masters,

How can I program a macro so that it expires after Jan 01, 2008. Any
help is greatly appreciated.

Thanks
-DC





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
how to expire Excel file after certain date Som Excel Discussion (Misc queries) 15 March 14th 09 03:58 PM
Expire count down Sweetie[_2_] Excel Worksheet Functions 5 September 19th 08 05:02 AM
Setting a date for a workbook to expire dave.d71 Excel Discussion (Misc queries) 4 June 4th 08 09:09 PM
Cause Macro to Expire MillMaster[_2_] Excel Programming 5 July 12th 06 06:45 PM
seeking way to expire excel documents after certain date in Office Rajat Excel Discussion (Misc queries) 2 September 30th 05 10:46 PM


All times are GMT +1. The time now is 11:35 PM.

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

About Us

"It's about Microsoft Excel"