Writing data into excel for unknown range using ActiveX commands

조회 수: 1 (최근 30일)
Suma
Suma 2012년 1월 27일
Data length is calculated using length()function. Data should start getting written from 'A3'. How can I specify the Range to be written since the end cell is unknown ? eg :A3+length(param) = A15 or so Matlab should calculate this on its own. Is it possible to do this?

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2012년 1월 27일
I think you can just use 'A3' (if also specifying a sheet name) or 'A3:A3' (if not specifying a sheet name, because 'A3' may be misinterpreted as a sheet name) to specify it as the first cell to begin writing the data from.
  댓글 수: 1
Suma
Suma 2012년 1월 27일
When I just use 'A3'or 'A3:A3' ,it fills out only A3.Thank you for your reply.
I found a way to do this in a for loop.
for ii = 3: length(param.name)+ 2
hCALWs.Range(['A',num2str(ii)]).set('Value',param.name{ii-2});
end
Thanks.

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by