필터 지우기
필터 지우기

actxserver move data in entire row few rows down

조회 수: 1 (최근 30일)
Louis
Louis 2020년 12월 4일
I am trying to use actxserver to format header row in an excel spreadsheet.
Before I manipulate header row, I would like to shift information in the second row (data row) down few rows to make additional spaces of rows between the header row and the data row.
I am having trouble doing seemingly simple task.
What I currently have is this:
function reformatHeader(excel_filename)
% Connect to the Excel COM object and open excel_filename
excel = actxserver('Excel.Application');
excel_wb = excel.Workbooks.Open(excel_filename);
sheet = excel_wb.ActiveSheet();
% Get the size of the sheet; assumes rectangular and not ragged
nColumns = sheet.Range('A1').End('xlToRight').Column;
nRows = sheet.Range('A1').End('xlDown').Row;
% Number of rows to add
nRowsToAdd = 2;
% I want to move the second row down by nRowsToAdd here
Basically the content of nRows should be moved to nRows+nRowsToAdd
There seems to be surprising little about of resources.. Is there a proper documentation with all commands?
I am using this at the moment, which isn't sufficient to do such simple operation: https://www.mathworks.com/help/matlab/matlab_external/using-a-matlab-application-as-an-automation-client.html
Thank you in advance.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Use COM Objects in MATLAB에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by