sharky12345
Well-known Member
- Joined
- Aug 5, 2010
- Messages
- 3,422
- Office Version
- 2016
- Platform
- Windows
I'm trying to enter a custom left footer in a Word document from excel but I'm getting an error 438 - 'Object doesn't support this property or method'.
Here's the code;
and it fails on this line;
Anyone help?
Here's the code;
Code:
Dim objWord As Object
Dim objDoc As Object
'Hide background file open
Application.ScreenUpdating = True
'Open Word if not already open
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.documents.Add(ThisWorkbook.path & "\Handover Pack.dotx") 'objWord.Documents.Add
objWord.Visible = True
'Front Page
objDoc.Tables(1).Cell(1, 1).Range.Text = "Operation " & Sheets("SETUP").Range("B1").Value
objDoc.Tables(1).Cell(2, 1).Range.Text = Sheets("SETUP").Range("D3").Value & " RTC"
objDoc.Tables(1).Cell(3, 1).Range.Text = Sheets("SETUP").Range("B6").Value
objDoc.Tables(1).Cell(4, 1).Range.Text = Sheets("SETUP").Range("B5").Text
objDoc.PageSetup.LeftFooter = "Op " & Sheets("SETUP").Range("B1").Value & " Handover"
and it fails on this line;
Code:
objDoc.PageSetup.LeftFooter = "Op " & Sheets("SETUP").Range("B1").Value & " Handover"
Anyone help?