I have a macro in a module within an Excel file (called "test.xlsm", saved on my desktop) that takes one argument as a string:
Sub macro1(str As String) Range("A1").Value = str End Sub
Using Mathematic Link for Excel add-in (version 3.5.0), I would like to run this macro directly from Mathematica 10.3:
In:= << ExcelLink` Needs["ExcelLink`"] ExcelOpen["\\\\Mac\\Home\\Desktop\\Test.xlsm"] ExcelRun["macro1", "string"]
However, when I run this code from within Mathematica, I get the following type mismatch error:
Out:= -Book: Test.xlsm- ExcelRun::failed: Type mismatch >> Out:= $Failed
When I call the macro from within Excel from another macro, it runs without any error.
I would appreciate any pointers or possible solutions. Thank you.