LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default excel file saves

I think you have a couple of choices.

You could just show the File|SaveAs dialog and let the user do their own save:

Option Explicit
Sub specialsave()

Dim myStr As String
myStr = Worksheets("sheet1").Range("a1").Value
'or
myStr = "P:/Work/Equipment/Jim Jones.xls"
Application.Dialogs(xlDialogSaveAs).Show arg1:=myStr

End Sub

Or you could ask the user for the name and then have the code save the workbook.


Option Explicit
Sub specialsave2()

Dim myFileName As Variant
Dim myStr As String
myStr = Worksheets("sheet1").Range("a1").Value
'or
myStr = "P:/Work/Equipment/Jim Jones.xls"

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

If myFileName = False Then
Exit Sub
End If

ActiveWorkbook.SaveAs Filename:=myFileName

End Sub


Cell reference as the file name field wrote:

I've created a fill and print form in Excel. The form contains a name field
that we would like to use as the file name. Basically when we select save as
it would go to the name box field and autofill the name on the save line.

Example;

P:/Work/Equipment/Jim Jones.xls
P:/Work/Equipment/Robert Brown.xls


--

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
Insert & link a graphic file in Excel 2003 -- updatable pictures! ODI Excel Discussion (Misc queries) 7 November 14th 05 02:36 PM
Reflecting info between an excel file and a word one or two excel file. Starriol Links and Linking in Excel 0 November 3rd 05 01:49 PM
Very slow in opening Excel 97 file in Excel 2003 S M Setting up and Configuration of Excel 0 October 22nd 05 07:32 PM
Read Text File into Excel Using VBA Willie T Excel Discussion (Misc queries) 13 January 8th 05 12:37 AM
Excel 2000 file when opened in Excel 2003 generates errors? Doug Excel Discussion (Misc queries) 13 December 25th 04 10:20 PM


All times are GMT +1. The time now is 04:27 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"