save as

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,

i have the following:

Dim sFileName As Sting
sFileName = Application.GetSaveAsFilename

I would like to know how to avoid displaying the file saver dialog box that
lets you choose the path. I would like to specify the path programatically.
Can anyone help with this?

thanks in advance,
geebee
 
Geebee,

you can use the SaveAs method of the workbook object. For example

Dim sFileName As Sting
sFileName="C:\Temp\Book1.xls"
ActiveWorkbook.SaveAs sFilename
 
As I understand you want the user to insert the filename, but you want to
define the path. When this is correct try to input the filename in an
inputbox as following:

Dim sFileName As String
Dim sDirName As String
sFileName = InputBox("Input Filename", "Input", "")
sDirName = "D:\My Documents\"
ActiveWorkbook.SaveAs Filename:=sDirName & sFileName, FileFormat _
:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:= _
False, CreateBackup:=False

Regards
Klaus
 

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

Back
Top