Rahxephon14
Civil/Environmental
- Jul 21, 2015
- 5
Hi !
I'm using Excel and I want to lunch SAP2000v17 with it but I have a problem with my code. Here is it :
I have always the same error. It says me :
I realy don't understand why it doesn't work.
Than you !
I'm using Excel and I want to lunch SAP2000v17 with it but I have a problem with my code. Here is it :
Code:
Option Explicit
Dim SapObject As SAP2000v17.cOAPI
Dim sapmodel As cSapModel
Dim ret As Long
Sub ouvrir_fichier()
Dim nom_fichier As String
Dim chemin As String
Dim kN_m_C As String
Set SapObject = CreateObject("CSI.SAP2000.API.SapObject")
ret = SapObject.ApplicationStart()
ret = SapObject.sapmodel.InitializeNewModel
chemin = Sheets(1).Range("chemin").Value
nom_fichier = Sheets(1).Range("nom_fichier").Value
ret = SapObject.sapmodel.File.OpenFile(chemin & "\" & nom_fichier & ".bdb")
ret = SapObject.sapmodel.SetPresentUnits(kN_m_C)
End Sub
I have always the same error. It says me :
Execution error '429'
An ActiveX component can't create an Object.
I realy don't understand why it doesn't work.
Than you !