Excel 上で VBA マクロを実行すると「実行時エラー '91'」が発生するのはなぜですか?
16 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 11 Mai 2012
Modifié(e) : MathWorks Support Team
le 14 Août 2015
次のコマンドをExcelのVBAマクロで実行すると、エラーが発生します。
Dim Matlab As Object
Dim server_version As String
Matlab = CreateObject("matlab.application")
server_version = Matlab.Execute("version")
実行時エラー '91':
オブジェクト変数または With ブロック変数が設定されていません。
Réponse acceptée
MathWorks Support Team
le 14 Août 2015
上記コードは VB コードのため、発生しています。Excel の VBA マクロを実行する場合は、Set コマンドが必要です。
Set MatLab = CreateObject("Matlab.Application")
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!