Excel Actxserver : Cell style

4 views (last 30 days)
Otto
Otto on 11 Mar 2021
Edited: Otto on 11 Mar 2021
Hi again,
I try to write data from a cell into an excel sheet:
xls = actxserver('Excel.Application');
% [...]
And the data:
data = {"Good", "Bad"; "Neutral", "Heading 3"};
Writing the data all at one time into an excel worksheet works fine:
r = this.wb.worksheets.item(sheet{:}).range("A1:B2");
r.value = data;
However when I try to set the style of the cells the same way it doesnt work:
r.style = data;
The cells are all styled as "Neutral" and also as "Heading 3".
Is there a way to assign the style without looping through all the rows and columns?

Answers (0)

Community Treasure Hunt

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

Start Hunting!