View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Nate[_6_] Nate[_6_] is offline
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