I write code at home and work. Home computer needs Microsoft Word 15.0 Object Library. When I program at work the reference changes to Microsoft Word 16.0 Object Library. Then the program hangs when back at home.
After searching I learned that I should use Late binding. The problem is that in late binding I get an error when setting the footer but it goes away with the reference set.
After searching I learned that I should use Late binding. The problem is that in late binding I get an error when setting the footer but it goes away with the reference set.
Code:
Dim myRange
'Early Binding
Dim wApp As Word.Application
Dim wDoc As Word.Document
Set wApp = CreateObject("Word.application")
Set wDoc = wApp.Documents.Add
'Late Binding
'Dim wApp As Object
'Dim wDoc As Object
'
'Set wApp = CreateObject("Word.Application")
'Set wDoc = wApp.Documents.Add
Last edited: