How can I open References to "excllink.xlam" in VBA
5 ビュー (過去 30 日間)
古いコメントを表示
How can I open References to "excllink.xlam" in VBA. It belongs to a Matlab example named" Exlisamp". When I want to open it in VBA it asks for password.
0 件のコメント
回答 (2 件)
Chidvi Modala
2021 年 3 月 8 日
It would be helpful if you can provide more details on the reproduction steps and the exact error you are facing. A screenshot of the error can be helpful. In the meanwhile you can refer to Work with Microsoft Visual Basic Editor section in https://www.mathworks.com/help/exlink/add-in-setup-1.html. This might help
Chidvi Modala
2021 年 3 月 8 日
An example VBA code is the following:
Sub MyTest()
Dim m As Object
Dim output As Variant
Dim x As Long
x = 6
ReDim rors(1 To x, 1 To 1)
Set m = CreateObject("Matlab.Application")
m.Feval "randi", 1, output, 4, 1, 6
Set m = Nothing
For i = 0 To 5
rors(i + 1, 1) = output(0)(0, i)
Next i
Set wb = ActiveWorkbook
Set ws = wb.Sheets("Sheet1")
Set TxtRng = ws.Range("A1:A6")
TxtRng.Value = rors
End Sub
The routine above calls the "randi" MATLAB function.
The "1" indicates the number of outputs, "output" the variable where to store the output of the function call, and finally "4,1,6" are the inputs to the "randi" function.
The "output" variable is then copied over to "rors", and finally written to cells A1 to A6.
You can also refer to a similar question asked here
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Introduction to Installation and Licensing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!