Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
oil_driller
 
Posts: n/a
Default Is there a way to insert a formula, password or macro in an excel spreadsheet that will automatically delete the spreadsheet?

Is there a way to insert a formula, password or macro in an excel
spreadsheet that will automatically delete the spreadsheet at the date you
specified?

thanks,

Charlie


  #2   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Hi Charlie

Delete the file is I think not a good idea?
Maybe the user have some information in it???
But it is possible, post back if you want to know how to do it

There is always a way to use your workbook if anybody wants it.
VBA is not save.

Put this in the workbook open event of the workbook.
After the date the file will be closed when you open it.

Private Sub Workbook_Open()
If Date DateSerial(2005, 4, 1) Then
ThisWorkbook.Close savechanges:=False
End If
End Sub

But macro's will not run when holding the shift key or disable macro's
So closing with a macro is not save.

Try the code above in combination with this

A good way is to hide all sheets except one and unhide them in
the workbook open event.
Place a message on that sheet with "you must enabled macro's to work with this file"
And hide the sheets in the beforeclose event.
So the user can't use the workbook if he disable macro's.
If he do the workbook open event don't run so there are no sheets
to work with
You must protect your project also in the VBA editor because a user can't unhide
the sheets there also if you don't do that

Some example code to do this
Sheet 1 stay always visible

Sub HidealmostAll()
Dim a As Integer
For a = 2 To Sheets.Count
Sheets(a).Visible = xlVeryHidden
Next a
End Sub

Sub ShowAll()
Dim a As Integer
For a = 2 To Sheets.Count
Sheets(a).Visible = True
Next a
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"oil_driller" wrote in message ...
Is there a way to insert a formula, password or macro in an excel spreadsheet that will automatically delete the spreadsheet at
the date you specified?

thanks,

Charlie



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
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
How do I insert the sigma symbol in an Excel spreadsheet? Sunita Excel Discussion (Misc queries) 1 January 18th 05 04:31 AM
Challenging Charting C TO Charts and Charting in Excel 0 January 17th 05 07:57 PM
Macro in Excel 2002 to save a workbook to a FTP location Lloyd Excel Discussion (Misc queries) 0 December 21st 04 03:49 PM
How do I password protect cells in a spreadsheet created in Excel [email protected] Excel Worksheet Functions 0 November 22nd 04 10:21 PM


All times are GMT +1. The time now is 09:24 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"