Hi Folks,
I got help with this before Christmas
With ActiveWorkbook
.SaveAs Filename:="" _
& .Worksheets("sheet1").Range("A3").Value _
& .Worksheets("sheet1").Range("B3").Value & ".xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End With
The problem is that my existing code shows an error if you have a file
name that already exists and you select Cancel or say No to saving over
the original file.
Can someone please let me have an example of how it should be.
Many thanks in anticipation
DonH
Bernie Deitrick - 18 Jan 2007 14:32 GMT
Don,
Put either of these (or both!) before your code:
On Error Resume Next
Application.DisplayAlerts = False
The first will get you out of the error situation that arises when the users presses Cancel or No to
the question, the second will allow Excel to automatically over-write any existing file.
HTH,
Bernie
MS Excel MVP
> Hi Folks,
>
[quoted text clipped - 17 lines]
>
> DonH
donh - 19 Jan 2007 09:42 GMT
Many thanks Bernie.
> Don,
>
[quoted text clipped - 31 lines]
> >
> > DonH