Date Validety on a file

  • Thread starter Thread starter Vikky
  • Start date Start date
V

Vikky

Hi experts;

I m using excel 2002.
Is it possible to give date vaildety to a excel file after that date
when anybody open that file excel would give Msg like " can not open
file. validety expired".

Thank you.

Regards;

Vikky
 
You could do something like

Private Sub Workbook_Open()
If Date > DateValue("12-Mar-2006") Then
MsgBox "Cannot open - expired"
ThisWorkbook.Close savechanges:=False
End If
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code

but a user can circumvent it by just disabling macros.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Thank you Bob for Replying.

I opened File,and pasted the code in view code, in all three sheets
code. But this is not giving desired result.

can you help me out, where i'm doing wrong.

Regards;

Vikky
 
Hi Vikky

Workbook_open, and other workbook related events, goes in the ThisWorkbook
module, no in sheets' modules.

HTH. Best wishes Harald
 
Vikky,

I gave precise instruction to get to the correct code module.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Hi;

One more Question;

I've made a file with n No. of formulas.
Can we disable the formula function after a particuler date.

Thanks.

Regards;

Vikky
 
You can make your formulas check the date
=IF(TODAY()<DATE(2006,8,8),SUM(A1:A100),"too late")
or you can create a macro that destroys stuff if the date is later than some
day.

But what you really ask is "can Excel protect my work" and the answer is no
way. You can keep unskilled users away from your secrets, but that's about
it. Excel protection is to protect against accidents, not to protect
content.

HTH. Best wishes Harald
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top