JE McGimpsey & Frank Kabel

M

Mike

Both of you replied to my File Name Exists
post. "Message unavailable" is what I get when I try to
view.

Could you email me your response please I am very
interested.

Thanks

Mike
 
T

Tom Ogilvy

Hi
you may try

fname = InputBox("Please Enter File Name", "File Name")
With Application.FileSearch
.lookin = "C:\Temp" 'change this
.Filename = fname
If .Execute then
fname = InputBox("FileName Exists Please Try
Again.", "File Exists")
Else
ActiveWorkbook.SaveAs Filename:=fname
End If
--
Regards
Frank Kabel
Frankfurt, Germany

One way:

fName = Application.InputBox( _
Prompt:="Please enter file name", _
Title:="File name", _
Type:=2)
Do Until Dir(fName) = ""
If fName = "False" Then Exit Sub 'user clicked Cancel
fName = Application.InputBox( _
Prompt:="FileName Exists Please Try Again.", _
Title:="File Exists", _
Type:=2)
Loop
ThisWorkbook.SaveAs Filename:=fName


----- JE McGimpsey ------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top