LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Question on SaveCopyAs


No, the filenames are different. The file being written out will have
name such as FCST_Mar-2408.xls and it's being written to a completel
different directory where the template file name is Forecast.xls.
(I've used the word "template" rather loosely, it's actually an xl
file, not an xlt.)

Here's the code to the last part of the macro where we're Saving th
Copy As and then re-opening the original file. We've commented out th
UNC address and replaced it with the fully qualified drive mapped pat
from a named range "TemplateDir", which we pickup by using th
cell("filename") function on the active sheet.

' Save file to destination directory, open original template
strDirPath = ActiveSheet.Range("DirectoryPath").Value
strFileName = ActiveSheet.Range("Category").Value
strBC = ActiveSheet.Range("Entity").Value
strFullName = strDirPath & "\" & strFileName & "-" & strBC
".xls"
ActiveWorkbook.SaveCopyAs FileName:=strFullName
Response = MsgBox("File has been copied to " & strFullName
vbOKOnly)
Application.DisplayAlerts = False
' Workbooks.Ope
FileName:="\\FNFNSH42\VOL1\MCAPPL\Hypprod5.5\Exp\W orkbook\Process\2006\Forecast\Forecast.xls"
Workbooks.Open FileName:=ActiveSheet.Range("TemplateDir").Value
"Forecast.xls"
Application.DisplayAlerts = Tru

--
taylor
-----------------------------------------------------------------------
taylorm's Profile: http://www.excelforum.com/member.php...fo&userid=2889
View this thread: http://www.excelforum.com/showthread.php?threadid=52499

 
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
savecopyas question scott23[_3_] Excel Programming 1 October 4th 04 02:12 PM
saveCopyAs judith Excel Programming 1 September 29th 04 11:21 AM
SaveCopyAs Greg Hadrych Excel Programming 4 July 28th 04 07:49 PM
SaveCopyAs Mark Worthington Excel Programming 4 February 8th 04 06:00 AM
SaveCopyAs macro Baddad007 Excel Programming 1 December 31st 03 12:26 AM


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