Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Check for file in folder

Hi all, i need to check a folder in a network drive "Q" to see if a file
exists, if it does, when was it created if older than 7 days give a
message are you sure you want to use this file, if younger than 7 days
open.

Some help with code would be appreciated.

Thanks in advance for any help..

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default Check for file in folder

Use the FileDateTime (<file) function:

if (now() - FileDateTime (<file)) 7) then
call MsgBox ("Your message")
else
[code...]
end if

Hope this helps,
Dom




Les Stout wrote:
Hi all, i need to check a folder in a network drive "Q" to see if a file
exists, if it does, when was it created if older than 7 days give a
message are you sure you want to use this file, if younger than 7 days
open.

Some help with code would be appreciated.

Thanks in advance for any help..

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Check for file in folder

Hi Dom,

done the trick, thanks very much..

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
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
Check if all formula's in a column are linked to the same file/folder mohavv Excel Discussion (Misc queries) 2 May 21st 08 03:00 AM
Save file in a new folder, but create folder only if folder doesn't already exist? nbaj2k[_40_] Excel Programming 6 August 11th 06 08:41 PM
Check if folder exists, if yes just copy sheet in to folder? Simon Lloyd[_787_] Excel Programming 3 June 19th 06 03:44 PM
How to check if a file exists in an ftp folder LL Cool A Excel Discussion (Misc queries) 3 May 16th 06 09:22 PM
check if file is in particular folder nikolaosk[_10_] Excel Programming 2 October 18th 03 04:25 PM


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