Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default autodestruction

Hi,
I try to protect my file from users modifying data.
Is there a way I can delete a file when I see they have change the data according to a specific date ??
I know it is strange but I need this to avoid corrupted files

TK
Douvid
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 473
Default autodestruction

Douvid wrote:
Is there a way I can delete a file when I see they have change the data
according to a specific date ??


Not sure what you mean by "according to a specific date"
In VBA you can find out the "last modified" date for a file using the FileDateTime function.
If the file is open (other than read-only) in Excel then this date will be misleading as it is
set to when the file was opened.

You can use the Kill statement to delete a file.

So

If FileDateTime("C:\MyFile.ext")DateSerial(2003,1,1) Then
Kill "C:\MyFile.ext"
End If


Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup

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



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