LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Save Current Workbook With Extended Filename

Hello,

I'm trying to write a macro to save (save as) the active workbook:

a. in the same directory
b. with a new filename (extension of the original)

Lets say the name of the original file is "test.xls". I would like to
Save As this file as "test_import.xls" in the same directory resulting
in the original file plus a copy with the extended name.

The following is a hard-coded approach which does what I need, but I
need to dynamically determine the file path and edit the name. The
extension to the name will always be "_import."


ChDir "C:\Temp"
ActiveWorkbook.SaveAs Filename:= _
"C:\Temp\test_import.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

Any help would be appreciated.

Thanks

 
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
SaveAs uses current open workbook filename; big wheelz Excel Programming 3 September 2nd 06 11:17 AM
save workbook as current date using a macro ExcelJon Excel Discussion (Misc queries) 2 June 21st 06 03:05 AM
Save Workbook as Current Date/Time Jacob_F_Roecker Excel Discussion (Misc queries) 1 October 25th 05 09:37 AM
unable to save current workbook within WorkbookBeforeClose TTN Excel Programming 4 November 20th 03 05:35 PM


All times are GMT +1. The time now is 02:29 AM.

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"