Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Routine for checking if file exists

On Wed, 26 Jan 2005 18:57:59 GMT, Centurion wrote...

1) how do I test (within VBA) to see if the file exists.


Sub FileExists()
Dim fFileExists As Boolean

fFileExists = (Len(Dir("C:\config.sys")) 0)
If fFileExists = True Then
msgbox "File Exists"
Else
msgbox "No File Found"
End If
End Sub

--
Met vriendelijke groeten / Mit freundlichen Grüßen / With kind
regards/Avec mes meilleures salutations
BBert

April 20, 1986
Celtics (135) - Bulls (131)
Larry Bird: "God disguised as Michael Jordan"
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
Checking to see if a file exists. JHB Excel Discussion (Misc queries) 3 August 5th 09 03:11 PM
Checking if Sheet Exists? [email protected] Excel Discussion (Misc queries) 5 September 1st 06 03:27 PM
Automating a data checking routine Tony Excel Programming 0 November 12th 04 10:03 AM
Checking if file exists in VBA NADavies Excel Programming 3 October 23rd 03 02:16 PM
Checking 2 c if workbook exists DavidMc Excel Programming 4 September 5th 03 07:34 PM


All times are GMT +1. The time now is 11:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"