title: How to access SAP2000's OpenAPI in PyWin32
body: <p>Python Win32 extensions can work with Microsoft Office applications, such as Word and Excel, using the <code>pywin32com.clients.Dispatch()</code> function call. There are other applications that can be similarly accessed using VBA. One such software is SAP2000 (Computers and Structures Inc.) which offers what it calls OpenAPI.</p>
  
  <p><strong>How can I access SAP2000's OpenAPI in Python Win32 extensions?</strong></p>
  
  <p>A typical VBA function to open SAP2000 from inside Excel goes as follows:</p>
  
  <pre><code>Dim SapObject As Sap2000.SapObject    
  Dim ret As Long
  
  Sub SAP2000_open()
      Set SapObject = New Sap2000.SapObject
      SapObject.ApplicationStart
      SapObject.SapModel.InitializeNewModel (lb_ft_F)
      ret = SapObject.SapModel.File.NewBlank
  End Sub
  </code></pre>
  
  <p>The above subroutine when run by attaching it to a button click event opens SAP2000.</p>