Help in the excel

HI All
I want to insert the data into the Excel sheet, but I wish the data to
be inserted in Excel Sheet is not in black color but in green color.
I had tried the following code for it, but it is not working.

Can anybody has the solution for it.

$worksheet.Range(“c#{b+1}”).Value = “Login page
verified.”.colorize(:green)
puts “\nWeb page opened successfully\n”.colorize(:green)

Thankx in advance :slight_smile:

Pranjal J. wrote:

HI All
I want to insert the data into the Excel sheet, but I wish the data to
be inserted in Excel Sheet is not in black color but in green color.
I had tried the following code for it, but it is not working.

Can anybody has the solution for it.

$worksheet.Range(“c#{b+1}”).Value = “Login page
verified.”.colorize(:green)
puts “\nWeb page opened successfully\n”.colorize(:green)

Thankx in advance :slight_smile:

Set the .Font.ColorIndex value of your range:

$worksheet.Range(“c#{b+1}”).Font.ColorIndex = 50

More color index values here:

http://www.ozgrid.com/VBA/ReturnCellColor.htm

Hope that helps.

David

http://rubyonwindows.blogspot.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs