Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default SaveAs uses current open workbook filename;

Hello:
I am looking for help on some "wildcard" type characters to use in a SaveAs
command that will default to using the file name of the workbook I am
currently wishing to save.

or, alternately

Looking for help with how to specify a complete path using the Save command.

I wish to not have to type in the name of the file, or rename it each time.
I also hope to be to add commands to include saving the .xls and .csv to an
ftp site as well. Current code below:

'
Rows("6:1000").Select
Selection.Sort Key1:=Range("C6"), Order1:=xlAscending, Key2:=Range("D6") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2 _
:=xlSortNormal
Columns("F:F").Select
Selection.NumberFormat = "mm/dd/yy;@"
Columns("B:R").Select
Selection.Columns.AutoFit
Range("A1").Select
Application.DisplayAlerts = False
ChDrive ("W")
ChDir "W:\PURCHASE\SF PRODUCTION Reports"
ActiveWorkbook.SaveAs FileFormat:= _
xlCSV, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
ActiveWorkbook.SaveAs FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default SaveAs uses current open workbook filename;

Here's some info on FTP via VBA from the geniuses at Daily Dose of
Excel:
http://www.dailydoseofexcel.com/arch...9/ftp-via-vba/
I don't understand what you are wanting to do with the save command.
Can you clarify please?

Charles

big wheelz wrote:
Hello:
I am looking for help on some "wildcard" type characters to use in a SaveAs
command that will default to using the file name of the workbook I am
currently wishing to save.

or, alternately

Looking for help with how to specify a complete path using the Save command.

I wish to not have to type in the name of the file, or rename it each time.
I also hope to be to add commands to include saving the .xls and .csv to an
ftp site as well. Current code below:

'
Rows("6:1000").Select
Selection.Sort Key1:=Range("C6"), Order1:=xlAscending, Key2:=Range("D6") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2 _
:=xlSortNormal
Columns("F:F").Select
Selection.NumberFormat = "mm/dd/yy;@"
Columns("B:R").Select
Selection.Columns.AutoFit
Range("A1").Select
Application.DisplayAlerts = False
ChDrive ("W")
ChDir "W:\PURCHASE\SF PRODUCTION Reports"
ActiveWorkbook.SaveAs FileFormat:= _
xlCSV, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
ActiveWorkbook.SaveAs FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default SaveAs uses current open workbook filename;

I am looking to use the saveas command, to specify the path, and then default
to the name of the active work book for the file name. With no prompts.

"Die_Another_Day" wrote:

Here's some info on FTP via VBA from the geniuses at Daily Dose of
Excel:
http://www.dailydoseofexcel.com/arch...9/ftp-via-vba/
I don't understand what you are wanting to do with the save command.
Can you clarify please?

Charles

big wheelz wrote:
Hello:
I am looking for help on some "wildcard" type characters to use in a SaveAs
command that will default to using the file name of the workbook I am
currently wishing to save.

or, alternately

Looking for help with how to specify a complete path using the Save command.

I wish to not have to type in the name of the file, or rename it each time.
I also hope to be to add commands to include saving the .xls and .csv to an
ftp site as well. Current code below:

'
Rows("6:1000").Select
Selection.Sort Key1:=Range("C6"), Order1:=xlAscending, Key2:=Range("D6") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2 _
:=xlSortNormal
Columns("F:F").Select
Selection.NumberFormat = "mm/dd/yy;@"
Columns("B:R").Select
Selection.Columns.AutoFit
Range("A1").Select
Application.DisplayAlerts = False
ChDrive ("W")
ChDir "W:\PURCHASE\SF PRODUCTION Reports"
ActiveWorkbook.SaveAs FileFormat:= _
xlCSV, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
ActiveWorkbook.SaveAs FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True
End Sub



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default SaveAs uses current open workbook filename;

You mean something like :

Workbooks("SomeOther.xls").SaveAs ActiveWorkbook.Name
This will not work, because you cannot have 2 WBs with the same name open in
the same instance of Excel.

NickHK

"big wheelz" ...
I am looking to use the saveas command, to specify the path, and then
default
to the name of the active work book for the file name. With no prompts.

"Die_Another_Day" wrote:

Here's some info on FTP via VBA from the geniuses at Daily Dose of
Excel:
http://www.dailydoseofexcel.com/arch...9/ftp-via-vba/
I don't understand what you are wanting to do with the save command.
Can you clarify please?

Charles

big wheelz wrote:
Hello:
I am looking for help on some "wildcard" type characters to use in a
SaveAs
command that will default to using the file name of the workbook I am
currently wishing to save.

or, alternately

Looking for help with how to specify a complete path using the Save
command.

I wish to not have to type in the name of the file, or rename it each
time.
I also hope to be to add commands to include saving the .xls and .csv
to an
ftp site as well. Current code below:

'
Rows("6:1000").Select
Selection.Sort Key1:=Range("C6"), Order1:=xlAscending,
Key2:=Range("D6") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1,
MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2 _
:=xlSortNormal
Columns("F:F").Select
Selection.NumberFormat = "mm/dd/yy;@"
Columns("B:R").Select
Selection.Columns.AutoFit
Range("A1").Select
Application.DisplayAlerts = False
ChDrive ("W")
ChDir "W:\PURCHASE\SF PRODUCTION Reports"
ActiveWorkbook.SaveAs FileFormat:= _
xlCSV, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
ActiveWorkbook.SaveAs FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True
End Sub





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 to grab current workbook filename TR Young Excel Worksheet Functions 3 June 12th 09 12:41 PM
Activating an Open Workbook without using the whole filename as a reference jlejehan Excel Programming 3 May 2nd 06 07:58 AM
Open filename using workbook property [email protected] Excel Programming 1 April 25th 06 02:19 AM
Open Workbook in current directory Elijah Excel Programming 3 November 30th 04 09:05 PM
Macro to open SaveAs... and change filename to cell value Andy Excel Programming 5 July 19th 04 12:23 PM


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