title: How to add a new column in Microsoft Project from Excel VBA?
body: <p>I'm writing a Sub in Excel right now with VBA. I've successfully opened a MS Project project. Now, I want to add a new column in the MS Project file via Excel VBA. How do I do this?</p>
  
  <p>'''vba</p>
  
  <pre><code>Dim MSProject As MSProject.Application
  Dim project As MSProject.project
  
  Dim wb As Workbook
  Dim ws As Worksheet
  
  Set wb = ThisWorkbook
  Set ws = Sheets("Sheet1")
  wb.Activate
  ws.Select
  
  ' Open Microsoft Project project
  Set MSProject = CreateObject("MSProject.Application")
  With MSProject
      .FileOpen "test.mpp"
      .Application.Visible = True
  End With
  
  Set project = MSProject.ActiveProject
  
  ' Add column in Project (this syntax does not work)
  MSProject.TableEditEx(Name:="test.mpp", TaskTable:=True, _NewFieldName:="JIRA Issue Key", Title:="JIRA Issue Key", Width:=15, _ShowInMenu:=True, _ColumnPosition:=1)
  </code></pre>
  
  <p>'''</p>