Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
No file when Save As is executed
The application.getsaveasfilename has a parameter that can be used to specify
the initial name (if you want to "suggest" a name to the user). If you don't want to suggest a name at all, you can use: fFilter = "Excel Files (*.xls), *.xls" SaveName = Application.GetSaveAsFilename(InitialFileName:="", _ fileFilter:=fFilter) And if you want to let excel suggest what it wants to suggest: fFilter = "Excel Files (*.xls), *.xls" SaveName = Application.GetSaveAsFilename(fileFilter:=fFilter) uriel78 wrote: I've got a question on this argument...How can I do to obtain a routine similar to the one you posted, which allows me to enter the name of the file in the same way I do when I choose "save as" from Fyle menu.. instead of typing it in the macro I mean I need sthg to subsitute the line NewName = "P2 LogHistory Shift" with a call for the windows displaying "save as"... Thanks in advance "Dave Peterson" ha scritto nel messaggio ... This line: SaveName = Application.GetSaveAsFilename _ (NewName, fileFilter:=fFilter) only returns the name of the file the user chose--it doesn't do the actual save. Sub RenameFilenameUponClose() Dim SaveName As variant '<--changed Dim fFilter As String Dim NewName As String NewName = "P2 LogHistory Shift" fFilter = "Excel Files (*.xls), *.xls" SaveName = Application.GetSaveAsFilename _ (NewName, fileFilter:=fFilter) if savename = false then 'use cancelled--what to do? else thisworkbook.saveas filename:=savename, fileformat:=xlworkbooknormal end if End Sub -- Dave Peterson |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
No file when Save As is executed
thank you for your help!!
"Dave Peterson" ha scritto nel messaggio ... The application.getsaveasfilename has a parameter that can be used to specify the initial name (if you want to "suggest" a name to the user). If you don't want to suggest a name at all, you can use: fFilter = "Excel Files (*.xls), *.xls" SaveName = Application.GetSaveAsFilename(InitialFileName:="", _ fileFilter:=fFilter) And if you want to let excel suggest what it wants to suggest: fFilter = "Excel Files (*.xls), *.xls" SaveName = Application.GetSaveAsFilename(fileFilter:=fFilter) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro get executed twice | Excel Discussion (Misc queries) | |||
Excell2003 (SP-1) File > Save and File > Save As.. grayed out | Excel Discussion (Misc queries) | |||
Excel marcos firing on file save as but not file save | Excel Programming | |||
How to create LOG file for commands executed in VB..? | Excel Programming | |||
Save File to Another Directory, but not change Users File Save location | Excel Programming |