quahog Posted December 1, 2003 Posted December 1, 2003 (edited) Does anyone know how to change the color of an Excel cell from within vb.net? Or change the color of the text within the cell. Either would be a help. Dim oExcel As Object Dim oBook As Object Dim oSheet As Object oExcel = CreateObject("Excel.Application") oBook = oExcel.Workbooks.Add oSheet = oBook.Worksheets(1) oSheet.Range("A1:J1").Font.name = "arial black" oSheet.Range("A1:J1").Font.Bold = True oSheet.Range("A1:J1").Font.size = 10 oSheet.Range("A1:J1").?????? I have tried every variation that I could think of. Any help would be greatly appreciated. Regards, Q Edited December 1, 2003 by quahog Quote when the day is bad and life's a curse, cheer up tomorrow may be worse.
Wamphyri Posted December 1, 2003 Posted December 1, 2003 Try using .Color or .ColorIndex 'Change font color Range("A1:J1").Font.Color = RGB(255, 0, 0) Range("A1:J1").Font.ColorIndex = 3 'Change cells interior color Range("A1:J1").Interior.Color = RGB(255, 0, 0) Range("A1:J1").Interior.ColorIndex = 3 Quote
quahog Posted December 1, 2003 Author Posted December 1, 2003 Carl - Thanks alot! Quote when the day is bad and life's a curse, cheer up tomorrow may be worse.
Recommended Posts