#1   Report Post  
Posted to microsoft.public.excel.programming
ew ew is offline
external usenet poster
 
Posts: 27
Default Kill file

I have an excel worksheet that I want to delete itself on a certain date. Is
there a code that I use to accomplish this?

Thanks for any help in the matter!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Kill file


EW wrote:
I have an excel worksheet that I want to delete itself on a certain date. Is
there a code that I use to accomplish this?

Thanks for any help in the matter!


Hi,

Try using the application.ontime method .. Check the help file for
additional info.

HTH,
Tausif

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default Kill file

I don't believe this is possible. For the workbook to delete itself, it has
to contain the code to do so: any attempt to delete the workbook will fail
since the workbook will be open at the time and if you close the workbook,
you lose the running code.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Kill file

Hi Tausif,

you can do that by Timer ... rather than application.ontime
But there will be a timer running each time you open XL.
that timer could be harmed your XL in wrong operation.

Sure that timer should be use correctly.

Rgds,

Halim

menuliskan:
EW wrote:
I have an excel worksheet that I want to delete itself on a certain date. Is
there a code that I use to accomplish this?

Thanks for any help in the matter!


Hi,

Try using the application.ontime method .. Check the help file for
additional info.

HTH,
Tausif


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default Kill file

In the ThisWorkbook module try...

Option Explicit
Dim Expiry As Long

Private Sub Workbook_Open()
Expiry = 38958 'serial number for date 8/29/6
If Date = Expiry Then
MsgBox "This workbook has expired." 'warning optional
With ThisWorkbook
.Save
.ChangeFileAccess Mode:=xlReadOnly
Kill .FullName
.Close SaveChanges:=False
End With
End If
End Sub

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
Kill file EW Excel Programming 8 August 17th 06 03:32 AM
Kill a File Posse John Excel Programming 2 August 4th 06 02:23 PM
Kill Michael Excel Programming 2 August 23rd 05 11:53 AM
'Kill' solomon_monkey Excel Programming 7 January 7th 05 09:56 AM
File kill help Marino13[_6_] Excel Programming 0 February 19th 04 01:40 PM


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