Hi
I am new to using VBA and would be grateful for advice. I am trying to put a simple command button on a spreadsheet that would open a word document that I want to use for mail-merge purposes. I am using the 2000 versions of both Word & Excel.
I have tried using the following code (picked from a number of advice sites!) but I get an error message "Automation error: The server threw an exception" when trying to run the code. Any help to get it working would be greatly appreciated!
Sub Button1_Click()
Dim wrdApp As Word.Application
Dim wrdDoc As Word.Document
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True
Set wrdDoc = wrdApp.Documents.Open("C:\LetterTemplate.doc")
End Sub
Many thanks
I am new to using VBA and would be grateful for advice. I am trying to put a simple command button on a spreadsheet that would open a word document that I want to use for mail-merge purposes. I am using the 2000 versions of both Word & Excel.
I have tried using the following code (picked from a number of advice sites!) but I get an error message "Automation error: The server threw an exception" when trying to run the code. Any help to get it working would be greatly appreciated!
Sub Button1_Click()
Dim wrdApp As Word.Application
Dim wrdDoc As Word.Document
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True
Set wrdDoc = wrdApp.Documents.Open("C:\LetterTemplate.doc")
End Sub
Many thanks