ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   save as (https://www.excelbanter.com/excel-programming/394559-save.html)

geebee

save as
 
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


downwitch

save as
 
Try ActiveWorkbook.SaveAs

geebee noSPAMs 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



Vergel Adriano

save as
 
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


reklamo

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



All times are GMT +1. The time now is 04:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com