Re: Error 400

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




Hi Bob,

Thx for this. The message box is a nice touch, i like that.
Sooo how do you know that the error number is 1004 ??

Thx again
Dave
Bob Phillips Wrote:
> Try this
>
> On Error Resume Next
> ActiveWorkbook.SaveAs _
> Filename:=ActiveWorkbook.Path & _
> "myfile " & Format(Date, "mm-dd-yyyy") & ".xls"
> If Err.Number = 1004 Then
> MsgBox "cancelled"
> End If
> On Error GoTo 0
>
>
> --
> HTH
>
> Bob Phillips
>
> (remove nothere from email address if mailing direct)
>
> "Desert Piranha"
> <Desert.Piranha.21b0yr_1136704226.2156@xxxxxxxxxxxxxxxxxxxxx> wrote in
> message
> news:Desert.Piranha.21b0yr_1136704226.2156@xxxxxxxxxxxxxxxxxxxxxxxx
> >
> > Hi all,
> >
> > I have this Save As code linked to a Option Button.
> > Everything works as i want it to, except when there is already been
> a
> > file saved with the current date.
> > Then i get a message box asking if i want to overwrite the file.
> > I DO want that.
> >
> > BUT if i answer "No" or "Cancel" i get a Visual Basic "Error 400"
> > thingy.
> > I DON'T want that error message.
> >
> > If i put like "Application.DisplayAlerts = False" in then it also
> > blocks the "Do i want to overwrite dialog",
> > which i want to keep.
> >
> >
> > Code:
> > --------------------
> > Private Sub SaveAsTo()
> > Application.ActiveWorkbook.SaveAs Filename:=ActiveWorkbook.Path &
> "\" &
> _
> > "myfile " & Format(Date, "mm-dd-yyyy") & ".xls"
> > End Sub
> > --------------------
> > Any direction on this would shurly be appreciated.
> >
> >
> > --
> > Desert Piranha
> >
> >
> >
> ------------------------------------------------------------------------
> > Desert Piranha's Profile:
> http://www.excelforum.com/member.php?action=getinfo&userid=28934
> > View this thread:
> http://www.excelforum.com/showthread.php?threadid=499135
> >


--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=28934
View this thread: http://www.excelforum.com/showthread.php?threadid=499135

.



Relevant Pages

  • Re: Error 400
    ... Thx Bob for your help. ... Bob Phillips Wrote: ... > "Desert Piranha" ...
    (microsoft.public.excel.programming)
  • Re: Different syntax for Application.Wait
    ... Hi Bob, ... Thx for this, ... > "Desert Piranha" ... >> Desert Piranha's Profile: ...
    (microsoft.public.excel.programming)
  • Re: Name of Right Click Menu
    ... Thx to Bob and Nick. ... Desert Piranha ...
    (microsoft.public.excel.programming)
  • Re: Change Ribbon Tabs by hovering
    ... menu system used in Excel 2007. ... Thx for the info. ... Desert Piranha ... Desert Piranha's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=28934 ...
    (microsoft.public.excel.misc)
  • Re: Copy & Paste code more efficient
    ... Ron & Carlo, ... Excellent, Thx very much ... Desert Piranha ... Desert Piranha's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=28934 ...
    (microsoft.public.excel.programming)