Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default Expiring/Killing Macro(s)

Can I have a macro written so as to expire/discard/terminate all the macros
in the current file after a month so as to restrict anyone else taking
benefit of using the same unless I renew the date therein. However, I don't
want the existing contents of the file to be damaged.

Thanx
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default Expiring/Killing Macro(s)

One way

Private Sub Workbook_Open()
msg = "You can't run macros in this workbook"
expires = Worksheets("Sheet1").Cells(1, 1).Value + 31
If Now expires Then MsgBox (msg)
myresponse = "mypassword"
msg = "enter password"
response = InputBox(msg)
If response = myresponse Then
Worksheets("Sheet1").Cells(1, 1).Value = Now
Else
ActiveWorkbook.Close
End If

End Sub
This prevents the workbook opening 31 days after a certain date.
In this example the date you want the 31 days to run from is in A1 of sheet1
which would need to be hidden and protected. Giving the correct password
changes that date and gives a further 31 days of usage.

I'm afraid it's not very secure though.

Mike
"FARAZ QURESHI" wrote:

Can I have a macro written so as to expire/discard/terminate all the macros
in the current file after a month so as to restrict anyone else taking
benefit of using the same unless I renew the date therein. However, I don't
want the existing contents of the file to be damaged.

Thanx

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default Expiring/Killing Macro(s)

Thanx Mike,

But actually what I want is that, I'm working quite good in a company due to
such macros I have created. But I don't want anyone else to take benefit of
such macros, in case I resign.

The workbook may be allowed to be opened however execution of the macros
should stop after 31 days, unless I, after entering the VBA password, modify
the date of expiration/stoppage of the macro.

"Mike" wrote:

One way

Private Sub Workbook_Open()
msg = "You can't run macros in this workbook"
expires = Worksheets("Sheet1").Cells(1, 1).Value + 31
If Now expires Then MsgBox (msg)
myresponse = "mypassword"
msg = "enter password"
response = InputBox(msg)
If response = myresponse Then
Worksheets("Sheet1").Cells(1, 1).Value = Now
Else
ActiveWorkbook.Close
End If

End Sub
This prevents the workbook opening 31 days after a certain date.
In this example the date you want the 31 days to run from is in A1 of sheet1
which would need to be hidden and protected. Giving the correct password
changes that date and gives a further 31 days of usage.

I'm afraid it's not very secure though.

Mike
"FARAZ QURESHI" wrote:

Can I have a macro written so as to expire/discard/terminate all the macros
in the current file after a month so as to restrict anyone else taking
benefit of using the same unless I renew the date therein. However, I don't
want the existing contents of the file to be damaged.

Thanx

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 299
Default Expiring/Killing Macro(s)

Don't know where you work but if it is in the US it would be illegal to
sabotage what is owned by the company.
Also it won't prevent anyone who has access to Google to bypass this. Excel
is not very safe except for maybe a casual user.
All VBA and sheet/workbook password can be easily cracked, the former with a
HEX editor and the latter with simple code.
File level passwords can be cracked with inexpensive software.
--


Regards,

Peo Sjoblom



"FARAZ QURESHI" wrote in message
...
Thanx Mike,

But actually what I want is that, I'm working quite good in a company due
to
such macros I have created. But I don't want anyone else to take benefit
of
such macros, in case I resign.

The workbook may be allowed to be opened however execution of the macros
should stop after 31 days, unless I, after entering the VBA password,
modify
the date of expiration/stoppage of the macro.

"Mike" wrote:

One way

Private Sub Workbook_Open()
msg = "You can't run macros in this workbook"
expires = Worksheets("Sheet1").Cells(1, 1).Value + 31
If Now expires Then MsgBox (msg)
myresponse = "mypassword"
msg = "enter password"
response = InputBox(msg)
If response = myresponse Then
Worksheets("Sheet1").Cells(1, 1).Value = Now
Else
ActiveWorkbook.Close
End If

End Sub
This prevents the workbook opening 31 days after a certain date.
In this example the date you want the 31 days to run from is in A1 of
sheet1
which would need to be hidden and protected. Giving the correct password
changes that date and gives a further 31 days of usage.

I'm afraid it's not very secure though.

Mike
"FARAZ QURESHI" wrote:

Can I have a macro written so as to expire/discard/terminate all the
macros
in the current file after a month so as to restrict anyone else taking
benefit of using the same unless I renew the date therein. However, I
don't
want the existing contents of the file to be damaged.

Thanx



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 64
Default Expiring/Killing Macro(s)

Well Stated Peo -- when you work for a company (assuming they're paying you
diligently), all code/applications you create for them is (by virture of the
employer/employee relationship) "Intellectual Property" of the Company.
Locking them out of your code (or otherwise sabotaging the application)
would put you in dire legal jeopardy.


"Peo Sjoblom" wrote in message
...
Don't know where you work but if it is in the US it would be illegal to
sabotage what is owned by the company.
Also it won't prevent anyone who has access to Google to bypass this.
Excel is not very safe except for maybe a casual user.
All VBA and sheet/workbook password can be easily cracked, the former with
a HEX editor and the latter with simple code.
File level passwords can be cracked with inexpensive software.
--


Regards,

Peo Sjoblom



"FARAZ QURESHI" wrote in message
...
Thanx Mike,

But actually what I want is that, I'm working quite good in a company due
to
such macros I have created. But I don't want anyone else to take benefit
of
such macros, in case I resign.

The workbook may be allowed to be opened however execution of the macros
should stop after 31 days, unless I, after entering the VBA password,
modify
the date of expiration/stoppage of the macro.

"Mike" wrote:

One way

Private Sub Workbook_Open()
msg = "You can't run macros in this workbook"
expires = Worksheets("Sheet1").Cells(1, 1).Value + 31
If Now expires Then MsgBox (msg)
myresponse = "mypassword"
msg = "enter password"
response = InputBox(msg)
If response = myresponse Then
Worksheets("Sheet1").Cells(1, 1).Value = Now
Else
ActiveWorkbook.Close
End If

End Sub
This prevents the workbook opening 31 days after a certain date.
In this example the date you want the 31 days to run from is in A1 of
sheet1
which would need to be hidden and protected. Giving the correct password
changes that date and gives a further 31 days of usage.

I'm afraid it's not very secure though.

Mike
"FARAZ QURESHI" wrote:

Can I have a macro written so as to expire/discard/terminate all the
macros
in the current file after a month so as to restrict anyone else taking
benefit of using the same unless I renew the date therein. However, I
don't
want the existing contents of the file to be damaged.

Thanx







  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6,582
Default Expiring/Killing Macro(s)

When I left my last employer, I had no qualms about leaving all my code.
Nobody there would ever be able to figure out how to use it (and I made no
attempt to make it hard to use).

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Doctorjones_md" wrote in message
...
Well Stated Peo -- when you work for a company (assuming they're paying
you diligently), all code/applications you create for them is (by virture
of the employer/employee relationship) "Intellectual Property" of the
Company. Locking them out of your code (or otherwise sabotaging the
application) would put you in dire legal jeopardy.


"Peo Sjoblom" wrote in message
...
Don't know where you work but if it is in the US it would be illegal to
sabotage what is owned by the company.
Also it won't prevent anyone who has access to Google to bypass this.
Excel is not very safe except for maybe a casual user.
All VBA and sheet/workbook password can be easily cracked, the former
with a HEX editor and the latter with simple code.
File level passwords can be cracked with inexpensive software.
--


Regards,

Peo Sjoblom



"FARAZ QURESHI" wrote in message
...
Thanx Mike,

But actually what I want is that, I'm working quite good in a company
due to
such macros I have created. But I don't want anyone else to take benefit
of
such macros, in case I resign.

The workbook may be allowed to be opened however execution of the macros
should stop after 31 days, unless I, after entering the VBA password,
modify
the date of expiration/stoppage of the macro.

"Mike" wrote:

One way

Private Sub Workbook_Open()
msg = "You can't run macros in this workbook"
expires = Worksheets("Sheet1").Cells(1, 1).Value + 31
If Now expires Then MsgBox (msg)
myresponse = "mypassword"
msg = "enter password"
response = InputBox(msg)
If response = myresponse Then
Worksheets("Sheet1").Cells(1, 1).Value = Now
Else
ActiveWorkbook.Close
End If

End Sub
This prevents the workbook opening 31 days after a certain date.
In this example the date you want the 31 days to run from is in A1 of
sheet1
which would need to be hidden and protected. Giving the correct
password
changes that date and gives a further 31 days of usage.

I'm afraid it's not very secure though.

Mike
"FARAZ QURESHI" wrote:

Can I have a macro written so as to expire/discard/terminate all the
macros
in the current file after a month so as to restrict anyone else
taking
benefit of using the same unless I renew the date therein. However, I
don't
want the existing contents of the file to be damaged.

Thanx







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
Macros Don't Show On Commands List and 'Normal.dot' SV Excel Worksheet Functions 3 December 13th 06 07:23 PM
Deleting phantom macros [email protected] Setting up and Configuration of Excel 2 September 8th 06 11:47 AM
Strip workbook of macros, VBA, MS Query, etc. Paul Kraemer Excel Discussion (Misc queries) 4 September 7th 06 01:30 PM
Hide Macro's in Toolbar / Macro's list sparx Excel Discussion (Misc queries) 2 May 6th 06 08:53 PM
how do I run excel 4.0 macros on excel 2000 RodolfoDallas Excel Discussion (Misc queries) 1 March 12th 06 03:14 AM


All times are GMT +1. The time now is 05:21 PM.

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"