It only needs minor changes primarily with the declarations for it to work in Excel, assuming that the table is already present in the template.
Sub FillHeader()
Dim objWord As Object
Dim objDocTgt As Object
Dim oSection As Object
Dim oHeader As Object
Dim oTable As Object
Dim oCell As Object
On Error Resume Next
Set objWord = GetObject(, "Word.Application")
If Err Then
Set objWord = CreateObject("Word.Application")
End If
On Error GoTo 0
Set objDocTgt = objWord.Documents.Add("C:\Path\xxx.dotx")
For Each oSection In objDocTgt.Sections
For Each oHeader In oSection.Headers
If oHeader.Exists Then
If oHeader.Range.Tables.Count > 0 Then
Set oTable = oHeader.Range.Tables(1)
Set oCell = oTable.Rows(1).Cells(1).Range
oCell.End = oCell.End - 1
oCell.Text = "Left part text" 'Replace with the appropriate value
Set oCell = oTable.Rows(1).Cells(2).Range
oCell.End = oCell.End - 1
oCell.Text = "Middle part text" 'Replace with the appropriate value
Set oCell = oTable.Rows(1).Cells(3).Range
oCell.End = oCell.End - 1
oCell.Text = "Right part text" 'Replace with the appropriate value
End If
End If
Next oHeader
Next oSection
End Sub