Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Som Som is offline
external usenet poster
 
Posts: 26
Default Expiry of MS Excel file

after a certain date(date will provided by the user) a password protected MS
excel file will not open with valid password OR the data of the said file
will be erased OR file will be corrupted .In one sentence , after a certain
date(date will provided by the user) a password protected MS excel file will
be destroyed in any form ??? (even if the 2nd line user copies (n number of
copies) the file to their own PCs also from our PC).I require this option for
some copyright / licence issue... Can u please help me?
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Expiry of MS Excel file

Hi Som

You need write a piece of code. From the menu go to
Tools--Macro--Visual Basic Editor--
Select Worksheet and copy the below code

Private Sub Workbook_Open()
If DateDiff("d","12/Mar/2009",Date) < -1 Then
Application.ActiveWorkbook.Close
End If
End Sub

This will only allow the workbook to be used upto Mar 12th. Password protect
the Visual Basic Editor before you distribute.

Jacob Skaria
(If this post is helpful please click Yes)

  #4   Report Post  
Posted to microsoft.public.excel.misc
Som Som is offline
external usenet poster
 
Posts: 26
Default Expiry of MS Excel file

No ,

it is not working...!!!!!!

I've given 11 march 2009

but it is openning......!!!!!!

one thing , I want to inform that here in my office by default MS Excel
Macro Security is 'VERY HIGH'.....

is this creating the problem?

*** how to give different password in MS Excel VB editor?

"Jacob Skaria" wrote:

Hi Som

You need write a piece of code. From the menu go to
Tools--Macro--Visual Basic Editor--
Select Worksheet and copy the below code

Private Sub Workbook_Open()
If DateDiff("d","12/Mar/2009",Date) < -1 Then
Application.ActiveWorkbook.Close
End If
End Sub

This will only allow the workbook to be used upto Mar 12th. Password protect
the Visual Basic Editor before you distribute.

Jacob Skaria
(If this post is helpful please click Yes)

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,819
Default Expiry of MS Excel file

That is because 11 march 2009 is BEFORE "12/Mar/2009", It is supposed to
open. try "13 march 2009" instead.

Som wrote:

No ,

it is not working...!!!!!!

I've given 11 march 2009

but it is openning......!!!!!!

one thing , I want to inform that here in my office by default MS Excel
Macro Security is 'VERY HIGH'.....

is this creating the problem?

*** how to give different password in MS Excel VB editor?

"Jacob Skaria" wrote:


Hi Som

You need write a piece of code. From the menu go to
Tools--Macro--Visual Basic Editor--
Select Worksheet and copy the below code

Private Sub Workbook_Open()
If DateDiff("d","12/Mar/2009",Date) < -1 Then
Application.ActiveWorkbook.Close
End If
End Sub

This will only allow the workbook to be used upto Mar 12th. Password protect
the Visual Basic Editor before you distribute.

Jacob Skaria
(If this post is helpful please click Yes)




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,819
Default Expiry of MS Excel file

Ignore this, I see the problem is you are missing the expiration day by
one.

Bob I wrote:

That is because 11 march 2009 is BEFORE "12/Mar/2009", It is supposed to
open. try "13 march 2009" instead.

Som wrote:

No ,

it is not working...!!!!!!

I've given 11 march 2009

but it is openning......!!!!!!

one thing , I want to inform that here in my office by default MS
Excel Macro Security is 'VERY HIGH'.....

is this creating the problem?

*** how to give different password in MS Excel VB editor?

"Jacob Skaria" wrote:


Hi Som

You need write a piece of code. From the menu go to
Tools--Macro--Visual Basic Editor--
Select Worksheet and copy the below code

Private Sub Workbook_Open()
If DateDiff("d","12/Mar/2009",Date) < -1 Then
Application.ActiveWorkbook.Close
End If
End Sub

This will only allow the workbook to be used upto Mar 12th. Password
protect the Visual Basic Editor before you distribute.

Jacob Skaria
(If this post is helpful please click Yes)



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Expiry of MS Excel file

Sorry, this should be....
If DateDiff("d","12/Mar/2009",Date) < 1

JacobSkaria

"Som" wrote:

No ,

it is not working...!!!!!!

I've given 11 march 2009

but it is openning......!!!!!!

one thing , I want to inform that here in my office by default MS Excel
Macro Security is 'VERY HIGH'.....

is this creating the problem?

*** how to give different password in MS Excel VB editor?

"Jacob Skaria" wrote:

Hi Som

You need write a piece of code. From the menu go to
Tools--Macro--Visual Basic Editor--
Select Worksheet and copy the below code

Private Sub Workbook_Open()
If DateDiff("d","12/Mar/2009",Date) < -1 Then
Application.ActiveWorkbook.Close
End If
End Sub

This will only allow the workbook to be used upto Mar 12th. Password protect
the Visual Basic Editor before you distribute.

Jacob Skaria
(If this post is helpful please click Yes)

  #9   Report Post  
Posted to microsoft.public.excel.misc
Som Som is offline
external usenet poster
 
Posts: 26
Default Expiry of MS Excel file

My code----

=====================
Private Sub Workbook_Open()
MsgBox "Ok"
MsgBox DateDiff("d", "10/Mar/2009", Date)
If DateDiff("d", "10/Mar/2009", Date) < 1 Then
MsgBox "Ok1"
Application.ActiveWorkbook.Close
End If
MsgBox "Ok2"
End Sub
======================================

result of manual run of MS VB macro

msg box ok coming
msg box 2 coming
msg box ok1 not coming
msg box ok2 coming

how to run the macro automatically

"Som" wrote:

No boss, it is not working.....!!!!!!!!

how this macro will run ? auto? i think there is some problem

my mail id is

can u pls send me atest mail , so that i can send u the file with i have
done...



"Jacob Skaria" wrote:

Sorry, this should be....
If DateDiff("d","12/Mar/2009",Date) < 1

JacobSkaria

"Som" wrote:

No ,

it is not working...!!!!!!

I've given 11 march 2009

but it is openning......!!!!!!

one thing , I want to inform that here in my office by default MS Excel
Macro Security is 'VERY HIGH'.....

is this creating the problem?

*** how to give different password in MS Excel VB editor?

"Jacob Skaria" wrote:

Hi Som

You need write a piece of code. From the menu go to
Tools--Macro--Visual Basic Editor--
Select Worksheet and copy the below code

Private Sub Workbook_Open()
If DateDiff("d","12/Mar/2009",Date) < -1 Then
Application.ActiveWorkbook.Close
End If
End Sub

This will only allow the workbook to be used upto Mar 12th. Password protect
the Visual Basic Editor before you distribute.

Jacob Skaria
(If this post is helpful please click Yes)

  #10   Report Post  
Posted to microsoft.public.excel.misc
Som Som is offline
external usenet poster
 
Posts: 26
Default Expiry of MS Excel file

my new code--------


===============================================+


Private Sub Workbook_Open()
MsgBox "Ok"
MsgBox DateDiff("d", "10/Mar/2009", Date)
If DateDiff("d", "10/Mar/2009", Date) 1 Then
MsgBox "Ok1"
Application.ActiveWorkbook.Close
End If
MsgBox "Ok2"
End Sub

==================================================

it is working ....... it should be greater than not less than !!!!!!!!!



"Som" wrote:

My code----

=====================
Private Sub Workbook_Open()
MsgBox "Ok"
MsgBox DateDiff("d", "10/Mar/2009", Date)
If DateDiff("d", "10/Mar/2009", Date) < 1 Then
MsgBox "Ok1"
Application.ActiveWorkbook.Close
End If
MsgBox "Ok2"
End Sub
======================================

result of manual run of MS VB macro

msg box ok coming
msg box 2 coming
msg box ok1 not coming
msg box ok2 coming

how to run the macro automatically

"Som" wrote:

No boss, it is not working.....!!!!!!!!

how this macro will run ? auto? i think there is some problem

my mail id is

can u pls send me atest mail , so that i can send u the file with i have
done...



"Jacob Skaria" wrote:

Sorry, this should be....
If DateDiff("d","12/Mar/2009",Date) < 1

JacobSkaria

"Som" wrote:

No ,

it is not working...!!!!!!

I've given 11 march 2009

but it is openning......!!!!!!

one thing , I want to inform that here in my office by default MS Excel
Macro Security is 'VERY HIGH'.....

is this creating the problem?

*** how to give different password in MS Excel VB editor?

"Jacob Skaria" wrote:

Hi Som

You need write a piece of code. From the menu go to
Tools--Macro--Visual Basic Editor--
Select Worksheet and copy the below code

Private Sub Workbook_Open()
If DateDiff("d","12/Mar/2009",Date) < -1 Then
Application.ActiveWorkbook.Close
End If
End Sub

This will only allow the workbook to be used upto Mar 12th. Password protect
the Visual Basic Editor before you distribute.

Jacob Skaria
(If this post is helpful please click Yes)



  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,819
Default Expiry of MS Excel file

Change the less than to greater than

If DateDiff("d", "10/Mar/2009", Date) 1 Then
--------------------------------------^

Som wrote:

My code----

=====================
Private Sub Workbook_Open()
MsgBox "Ok"
MsgBox DateDiff("d", "10/Mar/2009", Date)
If DateDiff("d", "10/Mar/2009", Date) < 1 Then
MsgBox "Ok1"
Application.ActiveWorkbook.Close
End If
MsgBox "Ok2"
End Sub
======================================

result of manual run of MS VB macro

msg box ok coming
msg box 2 coming
msg box ok1 not coming
msg box ok2 coming

how to run the macro automatically

"Som" wrote:


No boss, it is not working.....!!!!!!!!

how this macro will run ? auto? i think there is some problem

my mail id is

can u pls send me atest mail , so that i can send u the file with i have
done...



"Jacob Skaria" wrote:


Sorry, this should be....
If DateDiff("d","12/Mar/2009",Date) < 1

JacobSkaria

"Som" wrote:


No ,

it is not working...!!!!!!

I've given 11 march 2009

but it is openning......!!!!!!

one thing , I want to inform that here in my office by default MS Excel
Macro Security is 'VERY HIGH'.....

is this creating the problem?

*** how to give different password in MS Excel VB editor?

"Jacob Skaria" wrote:


Hi Som

You need write a piece of code. From the menu go to
Tools--Macro--Visual Basic Editor--
Select Worksheet and copy the below code

Private Sub Workbook_Open()
If DateDiff("d","12/Mar/2009",Date) < -1 Then
Application.ActiveWorkbook.Close
End If
End Sub

This will only allow the workbook to be used upto Mar 12th. Password protect
the Visual Basic Editor before you distribute.

Jacob Skaria
(If this post is helpful please click Yes)


  #12   Report Post  
Posted to microsoft.public.excel.misc
Som Som is offline
external usenet poster
 
Posts: 26
Default Expiry of MS Excel file

no it failed again in another PC....

because by default in my company , the macro level set very high... so it is
not running in other PCs

msg comnig -- " Macros are disabled because the security level is set very
high. To run the macros , change the security level to a lower setting and
verify the macros are signed & trusted"

, now what to do ??

i cann't change all PC s macro security setting of client location....

so i have to do the job keeping in my mind that " macro security will be
high "

now pls advise



"Som" wrote:

my new code--------


===============================================+


Private Sub Workbook_Open()
MsgBox "Ok"
MsgBox DateDiff("d", "10/Mar/2009", Date)
If DateDiff("d", "10/Mar/2009", Date) 1 Then
MsgBox "Ok1"
Application.ActiveWorkbook.Close
End If
MsgBox "Ok2"
End Sub

==================================================

it is working ....... it should be greater than not less than !!!!!!!!!



"Som" wrote:

My code----

=====================
Private Sub Workbook_Open()
MsgBox "Ok"
MsgBox DateDiff("d", "10/Mar/2009", Date)
If DateDiff("d", "10/Mar/2009", Date) < 1 Then
MsgBox "Ok1"
Application.ActiveWorkbook.Close
End If
MsgBox "Ok2"
End Sub
======================================

result of manual run of MS VB macro

msg box ok coming
msg box 2 coming
msg box ok1 not coming
msg box ok2 coming

how to run the macro automatically

"Som" wrote:

No boss, it is not working.....!!!!!!!!

how this macro will run ? auto? i think there is some problem

my mail id is

can u pls send me atest mail , so that i can send u the file with i have
done...



"Jacob Skaria" wrote:

Sorry, this should be....
If DateDiff("d","12/Mar/2009",Date) < 1

JacobSkaria

"Som" wrote:

No ,

it is not working...!!!!!!

I've given 11 march 2009

but it is openning......!!!!!!

one thing , I want to inform that here in my office by default MS Excel
Macro Security is 'VERY HIGH'.....

is this creating the problem?

*** how to give different password in MS Excel VB editor?

"Jacob Skaria" wrote:

Hi Som

You need write a piece of code. From the menu go to
Tools--Macro--Visual Basic Editor--
Select Worksheet and copy the below code

Private Sub Workbook_Open()
If DateDiff("d","12/Mar/2009",Date) < -1 Then
Application.ActiveWorkbook.Close
End If
End Sub

This will only allow the workbook to be used upto Mar 12th. Password protect
the Visual Basic Editor before you distribute.

Jacob Skaria
(If this post is helpful please click Yes)

  #13   Report Post  
Posted to microsoft.public.excel.misc
Som Som is offline
external usenet poster
 
Posts: 26
Default Expiry of MS Excel file

bob,

pls give me your mail id , my mail id is


pls see my new replies in this post.... it is running now , but it is giving
new problem

"Bob I" wrote:

Change the less than to greater than

If DateDiff("d", "10/Mar/2009", Date) 1 Then
--------------------------------------^

Som wrote:

My code----

=====================
Private Sub Workbook_Open()
MsgBox "Ok"
MsgBox DateDiff("d", "10/Mar/2009", Date)
If DateDiff("d", "10/Mar/2009", Date) < 1 Then
MsgBox "Ok1"
Application.ActiveWorkbook.Close
End If
MsgBox "Ok2"
End Sub
======================================

result of manual run of MS VB macro

msg box ok coming
msg box 2 coming
msg box ok1 not coming
msg box ok2 coming

how to run the macro automatically

"Som" wrote:


No boss, it is not working.....!!!!!!!!

how this macro will run ? auto? i think there is some problem

my mail id is


can u pls send me atest mail , so that i can send u the file with i have
done...



"Jacob Skaria" wrote:


Sorry, this should be....
If DateDiff("d","12/Mar/2009",Date) < 1

JacobSkaria

"Som" wrote:


No ,

it is not working...!!!!!!

I've given 11 march 2009

but it is openning......!!!!!!

one thing , I want to inform that here in my office by default MS Excel
Macro Security is 'VERY HIGH'.....

is this creating the problem?

*** how to give different password in MS Excel VB editor?

"Jacob Skaria" wrote:


Hi Som

You need write a piece of code. From the menu go to
Tools--Macro--Visual Basic Editor--
Select Worksheet and copy the below code

Private Sub Workbook_Open()
If DateDiff("d","12/Mar/2009",Date) < -1 Then
Application.ActiveWorkbook.Close
End If
End Sub

This will only allow the workbook to be used upto Mar 12th. Password protect
the Visual Basic Editor before you distribute.

Jacob Skaria
(If this post is helpful please click Yes)



  #14   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,819
Default Expiry of MS Excel file

Nope, i don't share mail IDs. Also if you aren't allowed to run macros,
how do you expect macros to perform the desired effect?

Som wrote:

bob,

pls give me your mail id , my mail id is


pls see my new replies in this post.... it is running now , but it is giving
new problem

"Bob I" wrote:


Change the less than to greater than

If DateDiff("d", "10/Mar/2009", Date) 1 Then
--------------------------------------^

Som wrote:


My code----

=====================
Private Sub Workbook_Open()
MsgBox "Ok"
MsgBox DateDiff("d", "10/Mar/2009", Date)
If DateDiff("d", "10/Mar/2009", Date) < 1 Then
MsgBox "Ok1"
Application.ActiveWorkbook.Close
End If
MsgBox "Ok2"
End Sub
======================================

result of manual run of MS VB macro

msg box ok coming
msg box 2 coming
msg box ok1 not coming
msg box ok2 coming

how to run the macro automatically

"Som" wrote:



No boss, it is not working.....!!!!!!!!

how this macro will run ? auto? i think there is some problem

my mail id is


can u pls send me atest mail , so that i can send u the file with i have
done...



"Jacob Skaria" wrote:



Sorry, this should be....
If DateDiff("d","12/Mar/2009",Date) < 1

JacobSkaria

"Som" wrote:



No ,

it is not working...!!!!!!

I've given 11 march 2009

but it is openning......!!!!!!

one thing , I want to inform that here in my office by default MS Excel
Macro Security is 'VERY HIGH'.....

is this creating the problem?

*** how to give different password in MS Excel VB editor?

"Jacob Skaria" wrote:



Hi Som

You need write a piece of code. From the menu go to
Tools--Macro--Visual Basic Editor--
Select Worksheet and copy the below code

Private Sub Workbook_Open()
If DateDiff("d","12/Mar/2009",Date) < -1 Then
Application.ActiveWorkbook.Close
End If
End Sub

This will only allow the workbook to be used upto Mar 12th. Password protect
the Visual Basic Editor before you distribute.

Jacob Skaria
(If this post is helpful please click Yes)




  #15   Report Post  
Posted to microsoft.public.excel.misc
Som Som is offline
external usenet poster
 
Posts: 26
Default Expiry of MS Excel file

OK ,

can u give me a code which will delete the excel file permanently if
somebody tries to open the file after the specified date ?

how to protect the code in the MS VB editor for macro , so that nobody can
see the code before expiry date / deletion date.


"Bob I" wrote:

Nope, i don't share mail IDs. Also if you aren't allowed to run macros,
how do you expect macros to perform the desired effect?

Som wrote:

bob,

pls give me your mail id , my mail id is


pls see my new replies in this post.... it is running now , but it is giving
new problem

"Bob I" wrote:


Change the less than to greater than

If DateDiff("d", "10/Mar/2009", Date) 1 Then
--------------------------------------^

Som wrote:


My code----

=====================
Private Sub Workbook_Open()
MsgBox "Ok"
MsgBox DateDiff("d", "10/Mar/2009", Date)
If DateDiff("d", "10/Mar/2009", Date) < 1 Then
MsgBox "Ok1"
Application.ActiveWorkbook.Close
End If
MsgBox "Ok2"
End Sub
======================================

result of manual run of MS VB macro

msg box ok coming
msg box 2 coming
msg box ok1 not coming
msg box ok2 coming

how to run the macro automatically

"Som" wrote:



No boss, it is not working.....!!!!!!!!

how this macro will run ? auto? i think there is some problem

my mail id is


can u pls send me atest mail , so that i can send u the file with i have
done...



"Jacob Skaria" wrote:



Sorry, this should be....
If DateDiff("d","12/Mar/2009",Date) < 1

JacobSkaria

"Som" wrote:



No ,

it is not working...!!!!!!

I've given 11 march 2009

but it is openning......!!!!!!

one thing , I want to inform that here in my office by default MS Excel
Macro Security is 'VERY HIGH'.....

is this creating the problem?

*** how to give different password in MS Excel VB editor?

"Jacob Skaria" wrote:



Hi Som

You need write a piece of code. From the menu go to
Tools--Macro--Visual Basic Editor--
Select Worksheet and copy the below code

Private Sub Workbook_Open()
If DateDiff("d","12/Mar/2009",Date) < -1 Then
Application.ActiveWorkbook.Close
End If
End Sub

This will only allow the workbook to be used upto Mar 12th. Password protect
the Visual Basic Editor before you distribute.

Jacob Skaria
(If this post is helpful please click Yes)







  #16   Report Post  
Posted to microsoft.public.excel.misc
Som Som is offline
external usenet poster
 
Posts: 26
Default Expiry of MS Excel file

dear all,

thanks for your involvement .

now the file is deleting if macro runs ....

1. how protect / encrypt the code.

2. next concern is Macro security is by default HIGH , I cann't give up !!!!
pls help me find out the way..... is there any option that wherever the file
will be openned the Macro security will be changed to LOW ??

3. is there anyother way apart from Macro to do the same?

I need to complete the job

waiting.......

"Som" wrote:

OK ,

can u give me a code which will delete the excel file permanently if
somebody tries to open the file after the specified date ?

how to protect the code in the MS VB editor for macro , so that nobody can
see the code before expiry date / deletion date.


"Bob I" wrote:

Nope, i don't share mail IDs. Also if you aren't allowed to run macros,
how do you expect macros to perform the desired effect?

Som wrote:

bob,

pls give me your mail id , my mail id is


pls see my new replies in this post.... it is running now , but it is giving
new problem

"Bob I" wrote:


Change the less than to greater than

If DateDiff("d", "10/Mar/2009", Date) 1 Then
--------------------------------------^

Som wrote:


My code----

=====================
Private Sub Workbook_Open()
MsgBox "Ok"
MsgBox DateDiff("d", "10/Mar/2009", Date)
If DateDiff("d", "10/Mar/2009", Date) < 1 Then
MsgBox "Ok1"
Application.ActiveWorkbook.Close
End If
MsgBox "Ok2"
End Sub
======================================

result of manual run of MS VB macro

msg box ok coming
msg box 2 coming
msg box ok1 not coming
msg box ok2 coming

how to run the macro automatically

"Som" wrote:



No boss, it is not working.....!!!!!!!!

how this macro will run ? auto? i think there is some problem

my mail id is


can u pls send me atest mail , so that i can send u the file with i have
done...



"Jacob Skaria" wrote:



Sorry, this should be....
If DateDiff("d","12/Mar/2009",Date) < 1

JacobSkaria

"Som" wrote:



No ,

it is not working...!!!!!!

I've given 11 march 2009

but it is openning......!!!!!!

one thing , I want to inform that here in my office by default MS Excel
Macro Security is 'VERY HIGH'.....

is this creating the problem?

*** how to give different password in MS Excel VB editor?

"Jacob Skaria" wrote:



Hi Som

You need write a piece of code. From the menu go to
Tools--Macro--Visual Basic Editor--
Select Worksheet and copy the below code

Private Sub Workbook_Open()
If DateDiff("d","12/Mar/2009",Date) < -1 Then
Application.ActiveWorkbook.Close
End If
End Sub

This will only allow the workbook to be used upto Mar 12th. Password protect
the Visual Basic Editor before you distribute.

Jacob Skaria
(If this post is helpful please click Yes)





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
Expiry mm/yy and validation Maki Excel Discussion (Misc queries) 4 September 1st 08 01:44 PM
VBA For Expiry date Alam Excel Discussion (Misc queries) 1 November 18th 07 11:36 AM
Expiry date Martina Excel Worksheet Functions 6 February 11th 07 09:57 PM
Date of expiry - warning? Jonas Excel Worksheet Functions 5 January 27th 06 08:21 PM
how do i set up an expiry date in an Excel worksheet AR Voice Excel Worksheet Functions 2 June 6th 05 10:22 PM


All times are GMT +1. The time now is 07:37 AM.

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"