If Dir("filepath and name" = "file name" Then
' File Exists
End If
So:
If Dir("C:\Documents And Settings\Word\Test.doc" = "Test.doc" Then
' File Exists
End If
As to changing the name, that will ultimatley depending on how you are currently working your setup....
Please post you sub or rotuine that is doing the work of saving the file so we can determine the appropriate place to put the name change.
****************************
Only two things are infinite, the universe and human stupidity,
and I'm not sure about the former. (Albert Einstein)
Robert L. Johnson III
MCSA, CNA, MCP, Network+, A+
w: robert.l.johnson.iii@citigroup.com
h: wildmage@tampabay.rr.com
Dim blnSave as Boolean
Dim strPath as String
strPath = "C:\data\file.xls"
blnSave = False
If Dir(strPath) <> "" Then
Do until blnSave = True
strPath = InputBox("File Exists. Please enter new path and name."
If Dir(strPath) = "" Then blnSave = True
Loop
End If
excel_sheet.saveas strPath
****************************
Only two things are infinite, the universe and human stupidity,
and I'm not sure about the former. (Albert Einstein)
Robert L. Johnson III
MCSA, CNA, MCP, Network+, A+
wildmage@tampabay.rr.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.