This task is need to perform while opening of the workbook, So this is related to events in the workbook and code should be written in the
ThisWorkBook module
Private Sub Workbook_Open()
With Sheet1.mapping
.AddItem "File to Table"
.AddItem "Table to File"
End With
End Sub