LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default How to Save As Variable File Name

I get you.

How about something like this:

Option Explicit
Sub testme01()

Dim SaveName As Variant
Dim qrPath As String

qrPath = "C:\my documents\excel\test\"

SaveName = qrPath & ActiveCell.Value & " - " & _
ActiveCell.Offset(-3, 2).Value & " Quote"

SaveName = Application.GetSaveAsFilename _
(InitialFileName:=SaveName, filefilter:="Excel Files, *.xls")

If SaveName = False Then
MsgBox "Please try later" 'user hit cancel
Else
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=SaveName, _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Application.DisplayAlerts = True
End If

End Sub

I used my own folder and changed SaveName to a variant--it can return False if
the user hits the cancel button.


wrote:

Hi,

This works, but it doesn't stop and let me update the filename. I'm
okay on the activecell since I move to it just before. The filename is
always correct, except I can't add to it.

You see the file name is "'company' - 'quote#' quote.xls", (were
company and quote# come nicely from cells), but since the customer
often does several quotes the same day for the same company they want
to be able to add something in the middle, i.e. "'company' 'stuff here'
- 'quote#' quote.xls". So I need the saveas to stop and allow filename
updates.

I hope this makes sense.

Thanks,

Michele


--

Dave Peterson
 
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
Excell2003 (SP-1) File > Save and File > Save As.. grayed out Joe Murphy Excel Discussion (Misc queries) 0 March 9th 05 10:00 PM
Save to Path & Variable file name Otto Moehrbach[_6_] Excel Programming 4 September 2nd 04 10:44 PM
Excel marcos firing on file save as but not file save Andy Excel Programming 1 August 3rd 04 10:34 AM
Save File to Another Directory, but not change Users File Save location Mike Knight Excel Programming 1 May 28th 04 09:06 PM
Using a variable string in a file save path Ron[_13_] Excel Programming 1 October 16th 03 08:29 PM


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

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

About Us

"It's about Microsoft Excel"