Thanks to the assistance of this Forum, I have reached a point where I am opening a word document and inserting text, at various bookmarks, derived from an Excel Sheet.
The data referenced "XXX" / xxx is inserted, though the macro crashes at zzz, without giving an explanatory message. If anybody could offer some advice, it would be greatly appreciated.
Code:
Dim psc As Variant
xxx = ActiveCell.Value
ActiveCell.Offset(0, 1).Range("A1").Select
Dim asm As Variant
zzz = ActiveCell.Value
ActiveCell.Offset(1, -2).Range("A1").Select
Dim wrdApp As Word.Application
Dim wrdDoc As Word.Document
Set wrdApp = CreateObject("Word.Application")
Set wrdDoc = wrdApp.Documents.Open("C:\Documents and Settings\gbgda\Desktop\New Test Folder\test quote.doc")
wrdDoc.Bookmarks("XXX").Range.Text = xxx
wrdDoc.Bookmarks("ZZZ").Range.Text = zzz
The data referenced "XXX" / xxx is inserted, though the macro crashes at zzz, without giving an explanatory message. If anybody could offer some advice, it would be greatly appreciated.