ExcelBanter

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

newbie

save file
 
hi

instead of oBook.SaveAs("c:\datalog.xls"),

how do i open up a dialog to save to a new excel file?

Tempy

save file
 
Hi Newbie,

I am also a newbie, so don't feel alone !!
I have just used the code below which works fine, i am sure it is not
the best, but it works. Critisism will be welcome.

Sub SaveFile()
'
'
Dim myValue As Variant
myValue = Application.InputBox(prompt:="Please enter the file save
name")

ChDir "C:\Datalog\"
ActiveWorkbook.SaveAs Filename:="C:\Datalog\" & myValue & ".xls", _
FileFormat:=xlNormal, CreateBackup:=False

MsgBox "Your file hase been saved as: " & "(" & myValue & ".XLS) " & "in
the datalog folder"
Application.Quit

End Sub

Tempy

*** Sent via Developersdex http://www.developersdex.com ***

Chip Pearson

save file
 
Try something like

Dim FName As Variant
FName = Application.GetOpenFilename("Excel files (*.xls),*.xls")
If FName = False Then
' user clicked cancel
Else
ActiveWorkbook.SaveAs Filename:=FName
End If



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"newbie" wrote in message
...
hi

instead of oBook.SaveAs("c:\datalog.xls"),

how do i open up a dialog to save to a new excel file?





All times are GMT +1. The time now is 01:03 PM.

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