Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving a workbook
Hi
I am trying to save a newly created workbook, using the value of a cell as its name. These cell values are used in the first workbook. [M24] = C:\Documents and Settings\Memos\ 'Pathway for file [M19] = Memo1 'file name Workbooks.Add Then, I've tried the following without success: Workbook.SaveAs ([M19] & ".xls") or ActiveWorkbook.SaveAs [M19] & ".xls" or ActiveWorkbook.SaveAs [M24] & [M19] & ".xls" or Workbooks(ActiveWorkbook).SaveAs [M19] & ".xls" Can someone please help me ? Thank you |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving a workbook
myfilename = "d:\somewhere\" & Range("customer") & "\" Range("address") ActiveWorkbook.SaveAs Filename:= _ myfilename, FileFormat _ :=xlNormal, Password:="", _ WriteResPassword:="", ReadOnlyRecommended:= _ False, CreateBackup:=False "customer" is a named range for a subdirectory for this to work, the subfolder already has to exist "address" is a named range for the actual file name you don't have to used named ranges, but I like to, because its easie to write formulas and work with code -- davesexce ----------------------------------------------------------------------- davesexcel's Profile: http://www.excelforum.com/member.php...fo&userid=3170 View this thread: http://www.excelforum.com/showthread.php?threadid=51664 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving a workbook
ActiveWorkbook.SaveAs Filename:=Range("M24") & Range("M19") & ".xls"
-- Cheers Nigel "Andrew B" wrote in message ... Hi I am trying to save a newly created workbook, using the value of a cell as its name. These cell values are used in the first workbook. [M24] = C:\Documents and Settings\Memos\ 'Pathway for file [M19] = Memo1 'file name Workbooks.Add Then, I've tried the following without success: Workbook.SaveAs ([M19] & ".xls") or ActiveWorkbook.SaveAs [M19] & ".xls" or ActiveWorkbook.SaveAs [M24] & [M19] & ".xls" or Workbooks(ActiveWorkbook).SaveAs [M19] & ".xls" Can someone please help me ? Thank you |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving a workbook
Thank you - it now works.
Andrew B |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
HELP -Saving a workbook | Excel Discussion (Misc queries) | |||
Color Changes When Saving 2007 Workbook as 97 - 2003 Workbook | Excel Discussion (Misc queries) | |||
Saving Workbook | Excel Discussion (Misc queries) | |||
Saving a sheet in a workbook as .csv but not changing workbook name | Excel Programming | |||
Saving a Workbook: Forcing User to Rename before Saving | Excel Programming |