How can I open and close RFEM/RSTAB in the background via the COM interface?


By initializing a variable of the Application (interface) type with "new", RFEM/RSTAB is started in the background. With this variable, you can also create a new model using the "CreateModel" method, or close the program using the "Close" command.

The following example shows how to start RSTAB, create a model with a node in the program, and close the program:

Sub RSTAB_open_close()

Dim filename As String
filename = Application.ActiveSheet.Cells(7, 3)

'   start rfem
Dim iApp As RSTAB8.Application
Set iApp = New RSTAB8.Application


On Error GoTo E

    '   create model
    Dim iMod As RSTAB8.IModel2
    Set iMod = iApp.CreateModel(filename)
    '   add data to model
    Dim nd As RSTAB8.Node = 10
    nd.X = 1
    nd.Y = 2
    nd.Z = 3
    Dim iModdata As RSTAB8.iModelData
    Set iModdata = iMod.GetModelData
    iModdata.SetNode nd
    iMod.Save filename

E:  If Err.Number <> 0 Then MsgBox Err.description, , Err.Source
    Set iModdata = Nothing
    Set iMod = Nothing
    Set iApp = Nothing
End Sub

The "iApp.Show" command is optional. This allows for displaying the program normally, not in the background.

Under Downloads, you can find an Excel macro with the subroutines for RFEM and RSTAB.

Please note that the folder, where the file is created, must exist.


COM Background Close Show Application


Contact us

Did you find your question?
If not, contact us via our free e-mail, chat, or forum support, or send us your question via the online form.

(267) 702-2815

RFEM Main Program
RFEM 5.xx

Main Program

Structural engineering software for finite element analysis (FEA) of planar and spatial structural systems consisting of plates, walls, shells, members (beams), solids and contact elements

Price of First License
3,540.00 USD
RSTAB Main Program
RSTAB 8.xx

Main Program

The structural engineering software for design of frame, beam and truss structures, performing linear and nonlinear calculations of internal forces, deformations, and support reactions

Price of First License
2,550.00 USD
RFEM Other
RF-COM 5.xx

Add-on Module

Programmable interface (API) based on the COM technology

Price of First License
580.00 USD
RS-COM 8.xx

Add-on Module

Programmable interface (API) based on the COM technology

Price of First License
580.00 USD