jtjcomp
asked on
vb 6 writing to excel
This is the code that i use to write to an excel worksheet, my question is how can i set the cell properties so that the back ground color is used.
I've tried backcolor and it did not work.
xlobj.Worksheets(1).Cells( Rows, 1).Value = rstPipe1.Fields("RecDate")
xlobj.Worksheets(1).Cells( Rows, 2).Value = rstPipe1.Fields("ReferralC ontact")
xlobj.Worksheets(1).Cells( Rows, 3).Value = rstPipe1.Fields("BusinessT ype")
xlobj.worksheets(1).range( A1:A14).ba ckcolor = somecolor
this does not work.
any suggestions.
thanx
I've tried backcolor and it did not work.
xlobj.Worksheets(1).Cells(
xlobj.Worksheets(1).Cells(
xlobj.Worksheets(1).Cells(
xlobj.worksheets(1).range(
this does not work.
any suggestions.
thanx
Sorry, last line should be
oRange.Interior.ColorIndex = YourColor
oRange.Interior.ColorIndex
ASKER
This is the line i used
xlobj.Worksheets(1).Range( "A1:N14"). Interior.C olorIndex = vbBlue
and it gave me error 1004 unable to set the colorindex property of the interior class,
any suggestions as to why
xlobj.Worksheets(1).Range(
and it gave me error 1004 unable to set the colorindex property of the interior class,
any suggestions as to why
Hmm... Try this:
xlobj.worksheets(1).range( A1:A14).se lect
xlobj.worksheets(1).select ion.Interi or.ColorIn dex = vbBlue
I remember that I did it. But now I haven't Excel installed...
xlobj.worksheets(1).range(
xlobj.worksheets(1).select
I remember that I did it. But now I haven't Excel installed...
ASKER
no, that did not work either.
ASKER
That is not working i will reopen the question and see if there are any other suggestions.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Using a number for the colorindex work!
Thanx for your help, Both of you.
Thanx for your help, Both of you.
jtjcomp
I'm happy to help you.
Thank you.
I'm happy to help you.
Thank you.
jtjcomp
I'm happy to help you.
Thank you.
I'm happy to help you.
Thank you.
jtjcomp
I'm happy to help you.
Thank you.
I'm happy to help you.
Thank you.
jtjcomp
I'm happy to help you.
Thank you.
I'm happy to help you.
Thank you.
Thanks !
oRange.ColorIndex = YourColor
HTH