Error trying to enter custom footer in Word from Excel

sharky12345

Well-known Member
Joined
Aug 5, 2010
Messages
3,422
Office Version
  1. 2016
Platform
  1. 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;

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?
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,223,805
Messages
6,174,723
Members
452,578
Latest member
Predaking

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top