Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Check if a File Exists

I need to check if a file exists before creating a new file.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Check if a File Exists


Function IsItThere()
Dim blnFile As Boolean
Dim strPath As String

strPath = "C:\Program Files\ahead\Nero\Boo.wav"
blnFile = Len(Dir(strPath))
MsgBox blnFile
End Function
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Ray Clark"
wrote in message
I need to check if a file exists before creating a new file.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Check if a File Exists

Thanks Jim great help.

"Jim Cone" wrote:


Function IsItThere()
Dim blnFile As Boolean
Dim strPath As String

strPath = "C:\Program Files\ahead\Nero\Boo.wav"
blnFile = Len(Dir(strPath))
MsgBox blnFile
End Function
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Ray Clark"
wrote in message
I need to check if a file exists before creating a new file.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default Check if a File Exists

If ("C:\Parade\zzz.txt") Then
Call KillFile
exit sub
' Else
End If
Missing something Want if file exists call KillFile if not by pass and
continue

"Jim Cone" wrote:


Function IsItThere()
Dim blnFile As Boolean
Dim strPath As String

strPath = "C:\Program Files\ahead\Nero\Boo.wav"
blnFile = Len(Dir(strPath))
MsgBox blnFile
End Function
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Ray Clark"
wrote in message
I need to check if a file exists before creating a new file.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Check if a File Exists

Sub WhatAmIDoing()
If IsItThere("C:\Parade\zzz.txt") Then
Call KillFile
Exit Sub
Else
'do something
End If
'more somethings
End Sub

Function IsItThere(ByRef strPath As String) As Boolean
Dim blnFile As Boolean
blnFile = Len(Dir(strPath))
IsItThere = blnFile
End Function
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Curt"
wrote in message
If ("C:\Parade\zzz.txt") Then
Call KillFile
exit sub
' Else
End If
Missing something Want if file exists call KillFile if not by pass and
continue



"Jim Cone" wrote:
Function IsItThere()
Dim blnFile As Boolean
Dim strPath As String

strPath = "C:\Program Files\ahead\Nero\Boo.wav"
blnFile = Len(Dir(strPath))
MsgBox blnFile
End Function
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware




"Ray Clark"
wrote in message
I need to check if a file exists before creating a new file.

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 file exists Jon Excel Discussion (Misc queries) 14 October 4th 07 04:57 PM
How do I check if a sheetname exists in a file? NezRhodes Excel Programming 2 August 22nd 06 09:44 AM
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 exists Curt Excel Programming 0 December 7th 05 05:02 PM
check if a file exists / is open Mark Kubicki Excel Programming 1 December 4th 03 05:56 PM


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