Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ActiveWorkbook.SaveAs problem
This should be obvious to me but I am having one of those days. The code below saves the file as R:\Cost\Development\Requote\mtxtSaveName.xls where what i am actually trying to achieve is that it saves as the result of mtxtSaveName to R:\Cost\Development\Requote Any help would be appreciated Regards Adrian Sub InsertDateAndSave() ' Dim mtxtCustomerName As String Dim mtxtBqName As String Dim mtxtFcode As String Dim mtxtRequoteDate As String Dim mtxtSaveName As Variant Range("B5").Select ActiveCell.FormulaR1C1 = "=NOW()" Range("B5").Select Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False mtxtCustomerName = Range("B6") mtxtBqName = Range("B8") mtxtFcode = Range("B7") mtxtRequoteDate = Range("B5") mtxtSaveName = (mtxtCustomerName & " " & mtxtBqName & " " & mtxtFcode _ & " " & mtxtRequoteDate) ActiveWorkbook.SaveAs Filename:= _ "R:\Cost\Development\Requote\mtxtSaveName.xls" , FileFormat:=xlNormal _ , Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _ CreateBackup:=False End Sub -- SandyUK ------------------------------------------------------------------------ SandyUK's Profile: http://www.excelforum.com/member.php...o&userid=17487 View this thread: http://www.excelforum.com/showthread...hreadid=484845 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
ActiveWorkbook.SaveAs problem
Sandy
How about ActiveWorkbook.SaveAs Filename:= _ "R:\Cost\Development\Requote\" + mtxtSaveName + ".xls", Here, it will replace the value of mtxtSaveName with the content of the variable Does this help? Kalpesh |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
ActiveWorkbook.SaveAs problem
Thanks for the response i had tried + and & with no joy but after a cu of coffee and a deep breath i tried a new search string on the site an think i have found my answer. Adria -- SandyU ----------------------------------------------------------------------- SandyUK's Profile: http://www.excelforum.com/member.php...fo&userid=1748 View this thread: http://www.excelforum.com/showthread.php?threadid=48484 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
'ActiveWorkbook.SaveAs Filename' | Excel Programming | |||
ActiveWorkbook.SaveAs Problem | Excel Programming | |||
activeworkbook.saveas - saving format changes | Excel Programming | |||
activeworkbook.saveas | Excel Programming | |||
Error on ActiveWorkbook.SaveAs method | Excel Programming |