Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default excel - save file - specify path and name

something which I have looked hard for is to be able to change path
and file name where I can input the text manually.
So I tried for myself and here is what I came up with. If you find it
useful let me know.


Dim myPath As String
Dim myFilename As String
'point at the (UNC) path here.
myPath = InputBox("enter path here")
If Right(myPath, 1) < "\" Then
myPath = myPath & "\"
End If
myFilename = InputBox("enter filename here") & " your text here if
common ending .xls"
ActiveWorkbook.SaveAs Filename:=myPath & myFilename

Cheers
Mark

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default excel - save file - specify path and name

Thats good work, but something you might find helpful:
dlgAnswer = Application.Dialogs(xlDialogSaveAs).Show
opens the dialog to let you choose where to put it instead of typing all of
that stuff.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


" wrote:

something which I have looked hard for is to be able to change path
and file name where I can input the text manually.
So I tried for myself and here is what I came up with. If you find it
useful let me know.


Dim myPath As String
Dim myFilename As String
'point at the (UNC) path here.
myPath = InputBox("enter path here")
If Right(myPath, 1) < "\" Then
myPath = myPath & "\"
End If
myFilename = InputBox("enter filename here") & " your text here if
common ending .xls"
ActiveWorkbook.SaveAs Filename:=myPath & myFilename

Cheers
Mark


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default excel - save file - specify path and name

On 30 Jul, 16:22, John Bundy (remove) wrote:
Thats good work, but something you might find helpful:
dlgAnswer = Application.Dialogs(xlDialogSaveAs).Show
opens the dialog to let you choose where to put it instead of typing all of
that stuff.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.



" wrote:
something which I have looked hard for is to be able to change path
and file name where I can input the text manually.
So I tried for myself and here is what I came up with. If you find it
useful let me know.


Dim myPath As String
Dim myFilename As String
'point at the (UNC) path here.
myPath = InputBox("enter path here")
If Right(myPath, 1) < "\" Then
myPath = myPath & "\"
End If
myFilename = InputBox("enter filename here") & " your text here if
common ending .xls"
ActiveWorkbook.SaveAs Filename:=myPath & myFilename


Cheers
Mark- Hide quoted text -


- Show quoted text -


Hi John,

Thats cool, I had been looking for a way to invoke the box but couodnt
find it. Thanks for that.

Mark

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
Formula too long - new file path is shorter than old file path - Excel 2003 Greg J Excel Worksheet Functions 1 November 22nd 06 05:16 PM
if i save as the excel file, macros path changed Selim Ozbas Excel Programming 3 October 9th 06 07:26 PM
Want to Set the File Save As path Brenda Excel Programming 1 February 24th 06 03:45 AM
Path\File name length problem Excel Crash on save as Datasort Excel Discussion (Misc queries) 0 April 8th 05 05:19 PM
get path - save new file - same sub-directory as existing file tegger Excel Programming 2 October 21st 03 10:45 AM


All times are GMT +1. The time now is 08:38 PM.

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"