I'm a newbie to programming and need help with a fairly simple VBA project for work. Starting in MS Excel, I'm trying to program a Macro to (1) open an existing file in MS Word, (2) enter some text from MS Excel into MS Word, and (3) Save the MS Word document with a dynamically generated file name.
For some reason, I can not get the MS Word document to save to a new file name. Would appreciate your help in figuring out what's wrong with this code!!
(Note: the variables dt and docName are created in an earlier part of the code and I'm confident they're working correctly. I'm just limiting the below code sample to the messed up code)
Dim wrdApp As Word.Application
Set wrdApp = CreateObject("Word.Application")
Dim wrdDoc As Word.Document
Set wrdDoc = wrdApp.Documents.Open("C:\Desktop\Quote_Template.doc")
.Selection.Goto What:=wdGoToBookmark, Name:="Date"
wrdDoc.SaveAs ("C:\Desktop\" & docName)