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

11 Ansichten (letzte 30 Tage)
Tod Flak
Tod Flak am 5 Dez. 2020
Beantwortet: kkluwehkg am 4 Mai 2022
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 ?

Antworten (1)

kkluwehkg
kkluwehkg am 4 Mai 2022
Have you installed the according Matlab Runtime ?

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by