Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro get executed twice Anand Nichkaode Excel Discussion (Misc queries) 3 September 24th 08 01:25 PM
Excell2003 (SP-1) File > Save and File > Save As.. grayed out Joe Murphy Excel Discussion (Misc queries) 0 March 9th 05 10:00 PM
Excel marcos firing on file save as but not file save Andy Excel Programming 1 August 3rd 04 10:34 AM
How to create LOG file for commands executed in VB..? Dayanand Excel Programming 5 June 3rd 04 12:46 PM
Save File to Another Directory, but not change Users File Save location Mike Knight Excel Programming 1 May 28th 04 09:06 PM


All times are GMT +1. The time now is 08:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"