Sub CreateWordTableFromExcelDataWithBordersAndWidthInCentimeters
Sub CreateWordTableFromExcelDataWithBordersAndWidthInCentimeters
On Error GoTo 0
End If
objWord.Visible = False ' You can set this to False to run Word in the background
' Populate the Word table with data from Excel and apply borders
' Set font size and font for the entire table
WordTable.Range.Font.Size = 9
' Set the width of specific columns in centimeters (adjust the values as needed)
' Populate the Word table with data from Excel and add borders
For i = 1 To ExcelRng.Rows.Count
For j = 1 To ExcelRng.Columns.Count
Next j
Next i
' Loop to add extra columns
For j = 1 To 3
WordTable.Columns.Add
Next j
objDoc.Close
objWord.Quit
End Sub