Thread: save as
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
reklamo reklamo is offline
external usenet poster
 
Posts: 41
Default save as

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





"Vergel Adriano" wrote:

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


--
Hope that helps.

Vergel Adriano


"geebee" wrote:

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