[問題] 如何Get handle to the open Excel已回收

看板MATLAB作者 (匿稱爽就好)時間16年前 (2009/03/20 11:06), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/1
在網路上找到了以下的code 但是不曉得為什麼在執行第一行的時候 就發生了Undefined command/function 'actxGetRunningServer'. 我找了一下發現的確沒有這個function不過網路上好像有很多人在使用 不知道是否要加裝甚麼toolkit才可以enable 希望有人可以指點!! % Get handle to the open Excel h = actxGetRunningServer('Excel.Application'); % Get workbook handle % You can select a differnt item number here or you can use % workbook name myBook = h.Workbooks.Item(1); % Get sheet handle (the same comments as above apply) mySheet = myBook.Item(1); % Now assign matrix to a range a = rand(5); mySheet.Range('A1:E5').Value = a; -- . . ★ .‧ . ‧ ‧ . ◤◥ . ‧ . ‧ . ** . ‧ . -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 160.39.57.60

03/25 23:16, , 1F
要不要去參考一下xlsread的m file?
03/25 23:16, 1F
文章代碼(AID): #19mmWvn6 (MATLAB)
文章代碼(AID): #19mmWvn6 (MATLAB)