Re: VBA code for Excel File Save As
From: Khlaudhya (Khlaudhya_at_discussions.microsoft.com)
Date: 07/30/04
- Next message: mangesh_yadav: "Re: Combo box"
- Previous message: mike: "Re: How to extend a standard class (like Work***)"
- In reply to: Ron de Bruin: "Re: VBA code for Excel File Save As"
- Next in thread: Norman Jones: "Re: VBA code for Excel File Save As"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 30 Jul 2004 01:39:03 -0700
Hi Ron,
thank you very much, this was really helpful.
Regards,
Khlaudhya
"Ron de Bruin" wrote:
> You can use GetSaveAsFilename
>
> Sub Test()
> Dim fname As Variant
> Dim Wb As Workbook
> Set Wb = ActiveWorkbook
>
> fname = Application.GetSaveAsFilename("", _
> fileFilter:="Excel Files (*.xls), *.xls")
> If fname <> False Then
> Wb.SaveAs fname
> 'Wb.Close False
> Set Wb = Nothing
> Else
> Set Wb = Nothing
> End If
> End Sub
>
>
> --
> Regards Ron de Bruin
> http://www.rondebruin.nl
>
>
> "khlaudhya" <khlaudhya@discussions.microsoft.com> wrote in message news:598B4C24-36D1-477C-8405-CB8DBD8D3512@microsoft.com...
> > Hi,
> >
> > I'm building a code where at some point I need to save the file to a new location with a specific file name, which is also
> specified by the code. I would like to be prompted for this but it only saves if I specify the path.
> >
> > This is the bit I have already written and can't go further:
> >
> > Dim NewName As String
> >
> > NewName = mRateName & " " & Validade & ".xls"
> >
> > If MsgBox("Save file as " & NewName & "?", vbYesNo, Save) = vbNo Then
> >
> > Exit Sub
> >
> > ActiveWorkbook.SaveAs FileName:=NewName
> >
> > Can anyone help me?
> >
> > Thanks
>
>
>
- Next message: mangesh_yadav: "Re: Combo box"
- Previous message: mike: "Re: How to extend a standard class (like Work***)"
- In reply to: Ron de Bruin: "Re: VBA code for Excel File Save As"
- Next in thread: Norman Jones: "Re: VBA code for Excel File Save As"
- Messages sorted by: [ date ] [ thread ]