Automation Error on CreateObje​ct("Matlab​.Applicati​on") in VBA

조회 수: 11 (최근 30일)
Tod Flak
Tod Flak 2020년 12월 5일
답변: kkluwehkg 2022년 5월 4일
I have an application that was previously working fine, running VBA code in Microsoft Access and working with MatLab as a COM Server. But I had to rebuild my computer, and lost my previous MatLab installation. So, I have currently installed a trial version of MatLabR2020b.
When I hit this VBA line:
Set m_objMatLab = CreateObject("Matlab.Application")
I get an error: " Run-time error '-2147467259 (80004005)'; Automation error Unspecified error"
I notice that the minimized MatLab icon briefly appears on the task bar, but then disappears; so it's obvious that it's instantiating the MatLab process.
I get the same error if I use the VBA syntax
Set m_objMatLab = New MLApp.MLApp
(with a project reference added to "MatLab Automation Server Type Library" )
I have followed the instructions on this page to ensure that MatLab is registered properly.
Also, if I follow the instructions in this answer to check the functionality of the MatLab as an ActiveX server by exexuting "h = actxserver('Matlab.Application')", it works fine ... I get the response "h = COM.Matlab_Application"; and then with "h.Execute('plot(1:10)')", the plot comes up fine.
Is it possible that the trial version of MatLab disallows use via ActiveX Automation ?

답변 (1개)

kkluwehkg
kkluwehkg 2022년 5월 4일
Have you installed the according Matlab Runtime ?

카테고리

Help CenterFile Exchange에서 ActiveX에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by