Cancel
Showing results for 
Search instead for 
Did you mean: 

Link Excel and FEMAP

Creator
Creator

Hi,

 

I am relatively new to FEMAP with a fair bit of experience in VBA. I am trying to make FEMAP and Excel exchange data but I encounter

429 error: ActiveX component can't create object

at line

 

Set fm = GetObject(, "femap.model")

(I have already declared fm variable)

 

 

I am using femap 10.0.2  32-bit and Excel 2016.

 

My guess is I am missing some *.dll files in either "C:\Windows\System32" or "C:\Windows\SysWOW64" directory but I am not sure which files, or even whether this is the problem at all!

 

Any idea would be very appreciated.

 

 

5 REPLIES

Re: Link Excel and FEMAP

Siemens Phenom Siemens Phenom
Siemens Phenom
Do you have FEMAP 10.0.2 open? The GetObject will only attach to an active FEMAP.

Use CreateObject to open and attach to a FEMAP that is not already running. You can make FEMAP visible or keep it hidden with this method.

Sub Main()

Dim fm As femap.Model
Set fm = CreateObject("femap.Model")
rc = fm.feAppVisible(True)
rc = fm.feAppMessage(0, "test")

End Sub

Re: Link Excel and FEMAP

Creator
Creator

Thanks for the response. FEMAP is open.

The CreateObject command also throws the same error.

By the way, I have already added the femap library reference to Excel.

Re: Link Excel and FEMAP

Siemens Phenom Siemens Phenom
Siemens Phenom
Have you run FEMAP 10.0.2 at least once As Administrator?

Re: Link Excel and FEMAP

Creator
Creator

Perfect! That solved the problem. I'd be grateful if you could provide details on what running as admin does and why this fixes the problem. Thanks so much.

Re: Link Excel and FEMAP

Siemens Phenom Siemens Phenom
Siemens Phenom

FEMAP needs Admin rights, the first time it runs, in order to register the OLE/COM server, that makes the API possible.