Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
xlsread Color of Cells

Subject: xlsread Color of Cells

From: Maxx Chatsko

Date: 2 Aug, 2010 15:50:25

Message: 1 of 5

Hello all,
     I know that you can write colors to a cell(s) in an Excel Spreadsheet, but how can I read them?
          Maxx

Subject: xlsread Color of Cells

From: Andy

Date: 2 Aug, 2010 15:59:05

Message: 2 of 5

"Maxx Chatsko" <chatskom@chemimage.com> wrote in message <i36pg1$clk$1@fred.mathworks.com>...
> Hello all,
> I know that you can write colors to a cell(s) in an Excel Spreadsheet, but how can I read them?
> Maxx

Do you mean you want to programmatically change or read the background color of specific cells? I believe you need to use actxserver to do this.

Subject: xlsread Color of Cells

From: Maxx Chatsko

Date: 2 Aug, 2010 16:14:10

Message: 3 of 5

"Andy " <myfakeemailaddress@gmail.com> wrote in message <i36q09$foo$1@fred.mathworks.com>...
> "Maxx Chatsko" <chatskom@chemimage.com> wrote in message <i36pg1$clk$1@fred.mathworks.com>...
> > Hello all,
> > I know that you can write colors to a cell(s) in an Excel Spreadsheet, but how can I read them?
> > Maxx
>
> Do you mean you want to programmatically change or read the background color of specific cells? I believe you need to use actxserver to do this.

    That is correct. I can't find any great examples though...

Subject: xlsread Color of Cells

From: Andy

Date: 2 Aug, 2010 16:24:10

Message: 4 of 5

"Maxx Chatsko" <chatskom@chemimage.com> wrote in message <i36qsi$en2$1@fred.mathworks.com>...
> "Andy " <myfakeemailaddress@gmail.com> wrote in message <i36q09$foo$1@fred.mathworks.com>...
> > "Maxx Chatsko" <chatskom@chemimage.com> wrote in message <i36pg1$clk$1@fred.mathworks.com>...
> > > Hello all,
> > > I know that you can write colors to a cell(s) in an Excel Spreadsheet, but how can I read them?
> > > Maxx
> >
> > Do you mean you want to programmatically change or read the background color of specific cells? I believe you need to use actxserver to do this.
>
> That is correct. I can't find any great examples though...

% sample

e = actxserver('excel.application');
eWs = e.Workbooks;
eW = eWs.Add;
eS = eW.ActiveSheet;
e.Visible = 1;
eR=eS.Range('A1:B10');
eR.Interior.ColorIndex=5;
eR.Border.ColorIndex=1; % to keep black border

Subject: xlsread Color of Cells

From: Maxx Chatsko

Date: 2 Aug, 2010 16:38:05

Message: 5 of 5

"Andy " <myfakeemailaddress@gmail.com>
> % sample
>
> e = actxserver('excel.application');
> eWs = e.Workbooks;
> eW = eWs.Add;
> eS = eW.ActiveSheet;
> e.Visible = 1;
> eR=eS.Range('A1:B10');
> eR.Interior.ColorIndex=5;
> eR.Border.ColorIndex=1; % to keep black border

   Thank you kind sir =)

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us