Conditional Formatting in Excel from Matlab/ActiveX

Joined
Jul 24, 2006
Messages
1
Reaction score
0
I’m making a spreadsheet from a Matlab function using the ActiveX link to Excel. I want to program in conditional formatting in the spreadsheet where cell A1 background changes to yellow based on its value. I took a guess based on a macro but it didn’t work. I’ve posted the code below. The function bombs out on the second line. Does anyone else know how to do this?

range = get(XL.Activesheet, 'Range', 'A1', 'A1');
set(range.FormatConditions.Add, 'Expression', '=$A$1<10');
set(range.FormatConditions(1).Interior, 'color', 65535);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top