Excel VBA - formatting Cell color
Posted on 2004-04-28
I am using a Spreadsheet object in conjunction with my ASP code. I found various properties for changing an Excel spreadsheet but can't figure out how to change the cell's background.
Set objSpreadsheet = Server.CreateObject("OWC.Spreadsheet")
objSpreadsheet.Cells(p,1).font.size = "12"
objSpreadsheet.Cells(p,1).font.bold = True
objSpreadsheet.Cells(p,1).font.italic = True
objSpreadsheet.Cells(p,1).font.color = vbRed
I'm not sure if these properties are coming straight from Excel VBA or what. I also don't know what vb is in vbRed because when I print this to the screen doing a Response.Write in ASP, the value behind vbRed is 255 which is probably the R in RGB but I still don't get it. I can't just plug in a color # like #ffffff. For instance jSpreadsheet.Cells(p,1).font.color = #RRRFFF won't work
so my 3 questions are:
1) Is this Excel VBA when I am using the OWC.Spreadsheet object?
2) How to change the cell's background color
3) What is vbRed