Matlab and excel issues, active x server crash

조회 수: 2 (최근 30일)
Tyler
Tyler 2013년 2월 20일
I am trying to write a program that will read blocks of data from an excel file, and then write them to another excel file. For some reason I cannot get xlswrite command to do what I am trying to do because of error issues. I decided to try to run an active x server and see if this could fix my problem. I am not very familiar with active x but i have been doing alot of research and I dont know what my issue is. For some reason when i try to run the code:
Excel = actxcontrol ('Excel. Application');
i get the error:
Control creation failed. Invalid ProgID 'Excel.Application'
I am running on matlab2008b and excel 2003

답변 (1개)

Mark Whirdy
Mark Whirdy 2013년 2월 20일
편집: Mark Whirdy 2013년 2월 23일
PLEASE PRESS [ACCEPT] IF THIS SOLVES YOUR ISSUE, THANKS
....
1) ACTXSERVER
For programmatic manipulation of an excel instance, the launch command is
Excel = actxserver('Excel.Application');
2) ACTXCONTROL
actxcontrol.m is for inserting a activex spreadsheet interface into a figure as per the below snippet. To see which version of the activex spreadsheet you have on your machine type "actxcontrollist" and scan downuntil you see a mention of a spreadsheet
f = figure;
actxcontrol('OWC11.Spreadsheet.11',[20,20,510,380],f);
---------------------------------------------
You are mixing the two up by typing
Excel = actxcontrol ('Excel. Application');
  댓글 수: 3
Tyler
Tyler 2013년 2월 20일
i understand that
Excel = actxserver('Excel.Application');
is the launch command which is my problem, that is the line of code that errors out. I dont understand what causes this to crash. From what i can tell any other example code uses that line to start.
Mark Whirdy
Mark Whirdy 2013년 2월 22일
편집: Mark Whirdy 2013년 2월 23일
Hi Tyler, but above you wrote that "Excel = actxcontrol ('Excel. Application');" causes the error.
Note that I have written "actxserver" but you have above written "actxcontrol" - they are not the same thing. The error you are receiving is due to erroneous calling of actxCONTROL.
Above I was trying to explain the difference between the two.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by