By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,645 Members | 1,047 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,645 IT Pros & Developers. It's quick & easy.

Change Excel.WorkBook default colors

P: n/a
Hi,
Tryin to use this method :
MyExcelObject.Application.ActiveWorkBook.set_Color s(int index, object RHS).

But really don't know what this RHS is ?

Any ideas ?
Thks for help
Nov 16 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Pierre,

RHS is an acronym for "Right Hand Side". The method you are calling is
really what is called when you set a property, and you should be using that
notation. I ^believe^ you want to be doing this:

MyExcelObject.Application.ActiveWorkBook.Colors[index] = color;

Remember that color is an RGB integer value, not a structure like it is
in .NET.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Pierre" <sa****@libertysurf.fr> wrote in message
news:41***********************@news.free.fr...
Hi,
Tryin to use this method :
MyExcelObject.Application.ActiveWorkBook.set_Color s(int index, object
RHS).

But really don't know what this RHS is ?

Any ideas ?
Thks for help

Nov 16 '05 #2

P: n/a
Thks but... ther's no ActiveWorkBook.Colors...

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> a écrit
dans le message de news:O9**************@TK2MSFTNGP14.phx.gbl...
Pierre,

RHS is an acronym for "Right Hand Side". The method you are calling is really what is called when you set a property, and you should be using that notation. I ^believe^ you want to be doing this:

MyExcelObject.Application.ActiveWorkBook.Colors[index] = color;

Remember that color is an RGB integer value, not a structure like it is in .NET.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Pierre" <sa****@libertysurf.fr> wrote in message
news:41***********************@news.free.fr...
Hi,
Tryin to use this method :
MyExcelObject.Application.ActiveWorkBook.set_Color s(int index, object
RHS).

But really don't know what this RHS is ?

Any ideas ?
Thks for help


Nov 16 '05 #3

P: n/a
Pierre,

There probably is, it's just that ActiveWorkbook returns a type of
object, which you have to cast to the workbook type.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Pierre" <sa****@libertysurf.fr> wrote in message
news:41***********************@news.free.fr...
Thks but... ther's no ActiveWorkBook.Colors...

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> a écrit
dans le message de news:O9**************@TK2MSFTNGP14.phx.gbl...
Pierre,

RHS is an acronym for "Right Hand Side". The method you are calling

is
really what is called when you set a property, and you should be using

that
notation. I ^believe^ you want to be doing this:

MyExcelObject.Application.ActiveWorkBook.Colors[index] = color;

Remember that color is an RGB integer value, not a structure like it

is
in .NET.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Pierre" <sa****@libertysurf.fr> wrote in message
news:41***********************@news.free.fr...
> Hi,
> Tryin to use this method :
> MyExcelObject.Application.ActiveWorkBook.set_Color s(int index, object
> RHS).
>
> But really don't know what this RHS is ?
>
> Any ideas ?
> Thks for help
>
>



Nov 16 '05 #4

P: n/a
I tried but no
((Excel.Workbook)xlsapp.ActiveWorkbook) has not "Color"

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> a écrit
dans le message de news:uv**************@TK2MSFTNGP14.phx.gbl...
Pierre,

There probably is, it's just that ActiveWorkbook returns a type of
object, which you have to cast to the workbook type.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Pierre" <sa****@libertysurf.fr> wrote in message
news:41***********************@news.free.fr...
Thks but... ther's no ActiveWorkBook.Colors...

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> a écrit dans le message de news:O9**************@TK2MSFTNGP14.phx.gbl...
Pierre,

RHS is an acronym for "Right Hand Side". The method you are
calling is
really what is called when you set a property, and you should be using

that
notation. I ^believe^ you want to be doing this:

MyExcelObject.Application.ActiveWorkBook.Colors[index] = color;

Remember that color is an RGB integer value, not a structure like
it is
in .NET.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Pierre" <sa****@libertysurf.fr> wrote in message
news:41***********************@news.free.fr...
> Hi,
> Tryin to use this method :
> MyExcelObject.Application.ActiveWorkBook.set_Color s(int index, object
> RHS).
>
> But really don't know what this RHS is ?
>
> Any ideas ?
> Thks for help
>
>



Nov 16 '05 #5

P: n/a
Pierre,

I should have seen it, but a workbook is a collection of worksheets.
What are you trying to change the color of? I think you should be getting a
sheet in the workbook, and then work with that.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Pierre" <sa****@libertysurf.fr> wrote in message
news:41**********************@news.free.fr...
I tried but no
((Excel.Workbook)xlsapp.ActiveWorkbook) has not "Color"

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> a écrit
dans le message de news:uv**************@TK2MSFTNGP14.phx.gbl...
Pierre,

There probably is, it's just that ActiveWorkbook returns a type of
object, which you have to cast to the workbook type.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Pierre" <sa****@libertysurf.fr> wrote in message
news:41***********************@news.free.fr...
> Thks but... ther's no ActiveWorkBook.Colors...
>
> "Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> a écrit > dans le message de news:O9**************@TK2MSFTNGP14.phx.gbl...
>> Pierre,
>>
>> RHS is an acronym for "Right Hand Side". The method you are calling > is
>> really what is called when you set a property, and you should be using
> that
>> notation. I ^believe^ you want to be doing this:
>>
>> MyExcelObject.Application.ActiveWorkBook.Colors[index] = color;
>>
>> Remember that color is an RGB integer value, not a structure like it > is
>> in .NET.
>>
>> Hope this helps.
>>
>>
>> --
>> - Nicholas Paldino [.NET/C# MVP]
>> - mv*@spam.guard.caspershouse.com
>>
>> "Pierre" <sa****@libertysurf.fr> wrote in message
>> news:41***********************@news.free.fr...
>> > Hi,
>> > Tryin to use this method :
>> > MyExcelObject.Application.ActiveWorkBook.set_Color s(int index,
>> > object
>> > RHS).
>> >
>> > But really don't know what this RHS is ?
>> >
>> > Any ideas ?
>> > Thks for help
>> >
>> >
>>
>>
>
>



Nov 16 '05 #6

P: n/a
So, Here is the point (I should have start with that ^^)
Got a C# App which is linked to a Sql Server database and allow the user to
export to Excel File and create Charts.
The user can select a color for each series that will build the chart.

My problem is that the C# app Color Set is different form the Excel One.
So, I just want to change the Default Excel Color Set to insert the C# Color
filled by the User....

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> a écrit
dans le message de news:OH**************@TK2MSFTNGP09.phx.gbl...
Pierre,

I should have seen it, but a workbook is a collection of worksheets.
What are you trying to change the color of? I think you should be getting a sheet in the workbook, and then work with that.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Pierre" <sa****@libertysurf.fr> wrote in message
news:41**********************@news.free.fr...
I tried but no
((Excel.Workbook)xlsapp.ActiveWorkbook) has not "Color"

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> a écrit dans le message de news:uv**************@TK2MSFTNGP14.phx.gbl...
Pierre,

There probably is, it's just that ActiveWorkbook returns a type of
object, which you have to cast to the workbook type.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Pierre" <sa****@libertysurf.fr> wrote in message
news:41***********************@news.free.fr...
> Thks but... ther's no ActiveWorkBook.Colors...
>
> "Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> a

écrit
> dans le message de news:O9**************@TK2MSFTNGP14.phx.gbl...
>> Pierre,
>>
>> RHS is an acronym for "Right Hand Side". The method you are

calling
> is
>> really what is called when you set a property, and you should be using > that
>> notation. I ^believe^ you want to be doing this:
>>
>> MyExcelObject.Application.ActiveWorkBook.Colors[index] = color;
>>
>> Remember that color is an RGB integer value, not a structure
like it
> is
>> in .NET.
>>
>> Hope this helps.
>>
>>
>> --
>> - Nicholas Paldino [.NET/C# MVP]
>> - mv*@spam.guard.caspershouse.com
>>
>> "Pierre" <sa****@libertysurf.fr> wrote in message
>> news:41***********************@news.free.fr...
>> > Hi,
>> > Tryin to use this method :
>> > MyExcelObject.Application.ActiveWorkBook.set_Color s(int index,
>> > object
>> > RHS).
>> >
>> > But really don't know what this RHS is ?
>> >
>> > Any ideas ?
>> > Thks for help
>> >
>> >
>>
>>
>
>



Nov 16 '05 #7

P: n/a
You say "a workbook is a collection of worksheets".
Not strictly true.
A workbook HAS a collection of worksheets.
"Nicholas Paldino [.NET/C# MVP]" wrote:
Pierre,

I should have seen it, but a workbook is a collection of worksheets.
What are you trying to change the color of? I think you should be getting a
sheet in the workbook, and then work with that.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Pierre" <sa****@libertysurf.fr> wrote in message
news:41**********************@news.free.fr...
I tried but no
((Excel.Workbook)xlsapp.ActiveWorkbook) has not "Color"

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> a écrit
dans le message de news:uv**************@TK2MSFTNGP14.phx.gbl...
Pierre,

There probably is, it's just that ActiveWorkbook returns a type of
object, which you have to cast to the workbook type.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Pierre" <sa****@libertysurf.fr> wrote in message
news:41***********************@news.free.fr...
> Thks but... ther's no ActiveWorkBook.Colors...
>
> "Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> a

écrit
> dans le message de news:O9**************@TK2MSFTNGP14.phx.gbl...
>> Pierre,
>>
>> RHS is an acronym for "Right Hand Side". The method you are

calling
> is
>> really what is called when you set a property, and you should be using
> that
>> notation. I ^believe^ you want to be doing this:
>>
>> MyExcelObject.Application.ActiveWorkBook.Colors[index] = color;
>>
>> Remember that color is an RGB integer value, not a structure like

it
> is
>> in .NET.
>>
>> Hope this helps.
>>
>>
>> --
>> - Nicholas Paldino [.NET/C# MVP]
>> - mv*@spam.guard.caspershouse.com
>>
>> "Pierre" <sa****@libertysurf.fr> wrote in message
>> news:41***********************@news.free.fr...
>> > Hi,
>> > Tryin to use this method :
>> > MyExcelObject.Application.ActiveWorkBook.set_Color s(int index,
>> > object
>> > RHS).
>> >
>> > But really don't know what this RHS is ?
>> >
>> > Any ideas ?
>> > Thks for help
>> >
>> >
>>
>>
>
>



Nov 16 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.