MWInitAppl​icationWit​hMCROption​s not working in Excel VBA

Hello Experts, I compiled an excel add-in using the Matlab R2014b version. As part of the package it created a bas file which I can use in my Excel VBA code to initialize the MCR and call the object. Since there are no screens involved I wanted to disable to JVM. Hence I compiled with the -R -nojvm option. Now when I try to run the code it fails at the statement Call MCLUtil.MWInitApplicationWithMCROptions(Application, mcrOptions) The error says that the MCR cannot be initialized. If I remove the options parameter then it initializes correctly. But I am using the code generated by the matlab compiler. Am I doing anything wrong. Kindly help. I appreciate it. If MCLUtil Is Nothing Then Set MCLUtil = CreateObject("MWComUtil.MWUtil8.4") End If Dim mcrOptions(1 To 1) As String mcrOptions(1) = "-R -nojvm" Call MCLUtil.MWInitApplicationWithMCROptions(Application, mcrOptions)
Thank you very much. Swapnil

Risposte (1)

if true
% If MCLUtil Is Nothing Then
Set MCLUtil = CreateObject("MWComUtil.MWUtil8.4")
End If
Dim mcrOptions(1 To 1) As String
mcrOptions(1) = "-R -nojvm"
Call MCLUtil.MWInitApplicationWithMCROptions(Application, mcrOptions)
end

Categorie

Richiesto:

il 19 Mar 2015

Risposto:

il 19 Mar 2015

Community Treasure Hunt

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

Start Hunting!

Translated by