Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
'ActiveWorkbook.SaveAs Filename' TOMB Excel Programming 2 February 15th 05 11:51 PM
ActiveWorkbook.SaveAs Problem SowBelly Excel Programming 4 August 4th 04 10:58 PM
activeworkbook.saveas - saving format changes tk3 Excel Programming 3 August 2nd 04 05:14 PM
activeworkbook.saveas J Silver Excel Programming 0 June 25th 04 09:01 PM
Error on ActiveWorkbook.SaveAs method cruisy Excel Programming 3 May 17th 04 08:40 AM


All times are GMT +1. The time now is 02:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"