Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default GetSaveAsFilename method

This is the code I am using to save a report I am running.

fileSaveName = Application.GetSaveAsFilename
(fileFilter:="Excel Files (*.xls), *.xls")
If fileSaveName < False Then
MsgBox "Save As " & fileSaveName
End If
ActiveWorkbook.Save
ActiveWindow.Close

How do I make it actually save the file as the name I
specify in the Save box? It just saves it as Book 1,2,
etc.

Thanks in Advance,
Donna Brooks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default GetSaveAsFilename method

If fileSaveName < False Then
ActiveWorkbook.SaveAs filename:= fileSaveName
End if
ActiveWorkbook.Close SaveChange:=False

Regards,
Tom Ogilvy


"Donna Brooks" wrote in message
...
This is the code I am using to save a report I am running.

fileSaveName = Application.GetSaveAsFilename
(fileFilter:="Excel Files (*.xls), *.xls")
If fileSaveName < False Then
MsgBox "Save As " & fileSaveName
End If
ActiveWorkbook.Save
ActiveWindow.Close

How do I make it actually save the file as the name I
specify in the Save box? It just saves it as Book 1,2,
etc.

Thanks in Advance,
Donna Brooks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default GetSaveAsFilename method-How to set the path?


How can I set the path and allow the user to assign a file name and
ensure the file is saved to the path I set?

Thanks,

Dan


On Tue, 8 Jul 2003 10:44:10 -0400, "Tom Ogilvy"
wrote:

If fileSaveName < False Then
ActiveWorkbook.SaveAs filename:= fileSaveName
End if
ActiveWorkbook.Close SaveChange:=False

Regards,
Tom Ogilvy


"Donna Brooks" wrote in message
...
This is the code I am using to save a report I am running.

fileSaveName = Application.GetSaveAsFilename
(fileFilter:="Excel Files (*.xls), *.xls")
If fileSaveName < False Then
MsgBox "Save As " & fileSaveName
End If
ActiveWorkbook.Save
ActiveWindow.Close

How do I make it actually save the file as the name I
specify in the Save box? It just saves it as Book 1,2,
etc.

Thanks in Advance,
Donna Brooks



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default GetSaveAsFilename method-How to set the path?

I tried the following code, but it returns: run time error 1004,
Application-defined or object-defined error. And it doesn't seem to
actually set the path.


CommandButton1 -click

Private Sub CommandButton1_Click()
ActiveWorkbook.SendMail ", "test", True
Set Workbook = ActiveWorkbook
Do
fName = "C:\Documents and Settings\dan dungan\My
Documents\jones\backup\" & Application.GetSaveAsFilename
Loop Until fName < False
ActiveWorkbook.SaveAs fName

End Sub





On Mon, 26 Jan 2004 22:14:14 -0800, wrote:


How can I set the path and allow the user to assign a file name and
ensure the file is saved to the path I set?

Thanks,

Dan


On Tue, 8 Jul 2003 10:44:10 -0400, "Tom Ogilvy"
wrote:

If fileSaveName < False Then
ActiveWorkbook.SaveAs filename:= fileSaveName
End if
ActiveWorkbook.Close SaveChange:=False

Regards,
Tom Ogilvy


"Donna Brooks" wrote in message
...
This is the code I am using to save a report I am running.

fileSaveName = Application.GetSaveAsFilename
(fileFilter:="Excel Files (*.xls), *.xls")
If fileSaveName < False Then
MsgBox "Save As " & fileSaveName
End If
ActiveWorkbook.Save
ActiveWindow.Close

How do I make it actually save the file as the name I
specify in the Save box? It just saves it as Book 1,2,
etc.

Thanks in Advance,
Donna Brooks



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default GetSaveAsFilename method-How to set the path?

GetSaveAsFileName is a method that provides a dialog box to get a file name,
it doesn't save the file, it simply returns the file name of the file that
was selected.

You can direct GetSaveAsFileName at a particular directory by setting that
directory before, like so

ChDir "C:\Documents and Settings\dan dungan\My Documents\jones\backup\"
Do
fName = Application.GetSaveAsFilename
Loop Until fName < False

ActiveWorkbook.SaveAs fName

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

wrote in message
...
I tried the following code, but it returns: run time error 1004,
Application-defined or object-defined error. And it doesn't seem to
actually set the path.


CommandButton1 -click

Private Sub CommandButton1_Click()
ActiveWorkbook.SendMail ", "test", True
Set Workbook = ActiveWorkbook
Do
fName = "C:\Documents and Settings\dan dungan\My
Documents\jones\backup\" & Application.GetSaveAsFilename
Loop Until fName < False
ActiveWorkbook.SaveAs fName

End Sub





On Mon, 26 Jan 2004 22:14:14 -0800, wrote:


How can I set the path and allow the user to assign a file name and
ensure the file is saved to the path I set?

Thanks,

Dan


On Tue, 8 Jul 2003 10:44:10 -0400, "Tom Ogilvy"
wrote:

If fileSaveName < False Then
ActiveWorkbook.SaveAs filename:= fileSaveName
End if
ActiveWorkbook.Close SaveChange:=False

Regards,
Tom Ogilvy


"Donna Brooks" wrote in message
...
This is the code I am using to save a report I am running.

fileSaveName = Application.GetSaveAsFilename
(fileFilter:="Excel Files (*.xls), *.xls")
If fileSaveName < False Then
MsgBox "Save As " & fileSaveName
End If
ActiveWorkbook.Save
ActiveWindow.Close

How do I make it actually save the file as the name I
specify in the Save box? It just saves it as Book 1,2,
etc.

Thanks in Advance,
Donna Brooks






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default GetSaveAsFilename method-How to set the path?

Just to add, the dialog will start in that directory, but the user can
navigate to any directory. If you just want the user to supply a filename,
use an input box and have them type one in.

--
Regards,
Tom Ogilvy

Bob Phillips wrote in message
...
GetSaveAsFileName is a method that provides a dialog box to get a file

name,
it doesn't save the file, it simply returns the file name of the file that
was selected.

You can direct GetSaveAsFileName at a particular directory by setting that
directory before, like so

ChDir "C:\Documents and Settings\dan dungan\My

Documents\jones\backup\"
Do
fName = Application.GetSaveAsFilename
Loop Until fName < False

ActiveWorkbook.SaveAs fName

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

wrote in message
...
I tried the following code, but it returns: run time error 1004,
Application-defined or object-defined error. And it doesn't seem to
actually set the path.


CommandButton1 -click

Private Sub CommandButton1_Click()
ActiveWorkbook.SendMail ", "test", True
Set Workbook = ActiveWorkbook
Do
fName = "C:\Documents and Settings\dan dungan\My
Documents\jones\backup\" & Application.GetSaveAsFilename
Loop Until fName < False
ActiveWorkbook.SaveAs fName

End Sub





On Mon, 26 Jan 2004 22:14:14 -0800, wrote:


How can I set the path and allow the user to assign a file name and
ensure the file is saved to the path I set?

Thanks,

Dan


On Tue, 8 Jul 2003 10:44:10 -0400, "Tom Ogilvy"
wrote:

If fileSaveName < False Then
ActiveWorkbook.SaveAs filename:= fileSaveName
End if
ActiveWorkbook.Close SaveChange:=False

Regards,
Tom Ogilvy


"Donna Brooks" wrote in message
...
This is the code I am using to save a report I am running.

fileSaveName = Application.GetSaveAsFilename
(fileFilter:="Excel Files (*.xls), *.xls")
If fileSaveName < False Then
MsgBox "Save As " & fileSaveName
End If
ActiveWorkbook.Save
ActiveWindow.Close

How do I make it actually save the file as the name I
specify in the Save box? It just saves it as Book 1,2,
etc.

Thanks in Advance,
Donna Brooks






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Please post this thread a correct full method, method about Nast Runsome New Users to Excel 8 February 25th 08 03:29 PM
Please post this thread a complete correct method, method about te Nast Runsome New Users to Excel 0 February 23rd 08 09:42 PM
Help with getsaveasfilename Jo Excel Discussion (Misc queries) 2 June 5th 07 12:41 AM
Another Method or 2? JMay Excel Discussion (Misc queries) 9 February 9th 07 08:11 PM
GetSaveAsFilename not working in Excel 2003 Mayur Patel Excel Discussion (Misc queries) 8 September 11th 05 08:44 PM


All times are GMT +1. The time now is 12:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"