OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

How to Make OOo Calc with an Expire Date?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
Mahogan
General User
General User


Joined: 20 May 2009
Posts: 28

PostPosted: Wed Mar 16, 2011 6:12 pm    Post subject: How to Make OOo Calc with an Expire Date? Reply with quote

My goal to make a spreadsheet expire after a certain date, say 30 days, and have a user enter a password to be able to open it after that date. Then have it reset to another 30 days and require a new password for the next expiration date and so on. This may not be possible, however, I did find that you can set a sheet to expire in Excel.

See below:

Type the code that makes the spreadsheet expire into the code box provided. A proper code format that provides users with a message regarding the expiration date and the number of days left until the spreadsheet expires looks like this:

Sub Auto_Open()\ Dim exdate As Date \ exdate = "12/01/10" \ If Date > exdate Then \ MsgBox ("Spreadsheet has Expired") \ ActiveWorkbook.Close \ End If \ MsgBox ("Workbook Valid Until" & exdate - Date & "Days left") \ End Sub

Enter the date that the spreadsheet should expire by "exdate=" and any message you prefer regarding the expired worksheet in the place of "Spreadsheet has Expired."

Here is the full context:
http://www.ehow.com/how_5916660_make-excel-spreadsheet-expire.html


Does anyone know how to get this to work in OOo Calc?

Any help is appreciated.
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Thu Mar 17, 2011 4:25 am    Post subject: Reply with quote

All I know is how to bypass auto-open in Excel and Calc.
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
Mahogan
General User
General User


Joined: 20 May 2009
Posts: 28

PostPosted: Thu Mar 17, 2011 7:39 am    Post subject: Similar Post Reply with quote

I see a similar post to make formulas obscure after a certain date.

http://www.oooforum.org/forum/viewtopic.phtml?t=74795&highlight=expire

However, I do not understand how to use it properly, I keep getting error 508 or Name?

where you have <your_calculation> do you reference the cell that you want the NA or do you actually put in the formula? I have tried both and neither work.
Back to top
View user's profile Send private message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Thu Mar 17, 2011 9:09 am    Post subject: Reply with quote

You can put this macro in the document then use Tools > Customize > Events tab to tie it to the "Open Document" event.
Code:

Sub Expire
Dim d as Date
d = "3/20/11"
If Date > d then
  MsgBox "Expired after " & d & "!"
  ThisComponent.Dispose
 Else MsgBox "Expires after " & d & "."
EndIf
End Sub
Back to top
View user's profile Send private message
Mahogan
General User
General User


Joined: 20 May 2009
Posts: 28

PostPosted: Thu Mar 17, 2011 10:34 am    Post subject: This is a good step forward. Reply with quote

Thanks JohnV, that does work quite well for the initial 30 days expire time. Now the next challenge is how to get it to ask for a unique password that would at the same time reset the expire date to an additional 30 days and so on...
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Thu Mar 17, 2011 11:17 am    Post subject: Reply with quote

This is not a stand-up coder competition. You are not able to apply simple spreadsheet formulas while begging others to write program for you with constantly changing requirements.
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
Mahogan
General User
General User


Joined: 20 May 2009
Posts: 28

PostPosted: Thu Mar 17, 2011 11:46 am    Post subject: Courtesty requested. Reply with quote

Villeroy that is quite an attack! Too bad you feel that way.

As my post initially read
Quote:
My goal to make a spreadsheet expire after a certain date, say 30 days, and have a user enter a password to be able to open it after that date. Then have it reset to another 30 days and require a new password for the next expiration date and so on. This may not be possible...


No where am I constantly changing requirements, nor begging! Perhaps you misunderstood.

While admittedly I am no Super User, I thought the main reason for a User Forum is to Help Others and hopefully in a courteous manner, perhaps I misunderstand?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group