Kevz
Structural
- Jul 16, 2024
- 1
Hello! I just started using ETABS API and I'm having a trouble on exporting table to excel. Can someone correct my code below? Thanks
Sub ExportFramePropertyModifiersToExcel()
'set the following flag to True to attach to an existing instance of the program
'otherwise a new instance of the program will be started
Dim AttachToInstance As Boolean
AttachToInstance = True
'create API helper object
Dim myHelper As ETABSv1.cHelper
Set myHelper = New ETABSv1.Helper
'dimension the ETABS Object as cOAPI type
Dim myETABSObject As ETABSv1.cOAPI
Set myETABSObject = myHelper.GetObject("CSI.ETABS.API.ETABSObject")
'use ret to check return values of API calls
Dim ret As Long
'get a reference to cSapModel to access all API classes and functions
Dim mySapModel As ETABSv1.cSapModel
Set mySapModel = myETABSObject.SapModel
' Access the cDatabaseTables interface
Set DatabaseTables = mySapModel.DatabaseTables
Dim TableKeyList() As String
Dim WindowHandle As Integer
TableKeyList() = Range("A3:A4").Value
ret = DatabaseTables.ShowTablesInExcel(TableKeyList, 1)
End Sub
Sub ExportFramePropertyModifiersToExcel()
'set the following flag to True to attach to an existing instance of the program
'otherwise a new instance of the program will be started
Dim AttachToInstance As Boolean
AttachToInstance = True
'create API helper object
Dim myHelper As ETABSv1.cHelper
Set myHelper = New ETABSv1.Helper
'dimension the ETABS Object as cOAPI type
Dim myETABSObject As ETABSv1.cOAPI
Set myETABSObject = myHelper.GetObject("CSI.ETABS.API.ETABSObject")
'use ret to check return values of API calls
Dim ret As Long
'get a reference to cSapModel to access all API classes and functions
Dim mySapModel As ETABSv1.cSapModel
Set mySapModel = myETABSObject.SapModel
' Access the cDatabaseTables interface
Set DatabaseTables = mySapModel.DatabaseTables
Dim TableKeyList() As String
Dim WindowHandle As Integer
TableKeyList() = Range("A3:A4").Value
ret = DatabaseTables.ShowTablesInExcel(TableKeyList, 1)
End Sub