G
Guest
I working with Excel file by using the OLEDB components such :
OleDbConnection ,OleDbCommand.
I successfuly read/update the Excel table.
The problem is how can I change the color of spicific location, I can update
spicifc value by somthing like :
_oleCmdUpdate =new OleDbCommand(
@" Update ["
+ _strSheetName
"$" + _strSheetRange
+ "] set F1=" + strVal, _oleConn);
How can I change color this spicific location in Excel table, I find
somthing in VB not C# , any one can convert tho following VB code to C# ? How
can do the same in C#?
Sub ColorCells()
On Error Resume Next
With Sheet1.UsedRange
.SpecialCells(xlCellTypeFormulas).Font.Color = vbBlack
.SpecialCells(xlCellTypeConstants).Font.Color = vbBlue
End With
On Error GoTo 0
End Sub
OleDbConnection ,OleDbCommand.
I successfuly read/update the Excel table.
The problem is how can I change the color of spicific location, I can update
spicifc value by somthing like :
_oleCmdUpdate =new OleDbCommand(
@" Update ["
+ _strSheetName
"$" + _strSheetRange
+ "] set F1=" + strVal, _oleConn);
How can I change color this spicific location in Excel table, I find
somthing in VB not C# , any one can convert tho following VB code to C# ? How
can do the same in C#?
Sub ColorCells()
On Error Resume Next
With Sheet1.UsedRange
.SpecialCells(xlCellTypeFormulas).Font.Color = vbBlack
.SpecialCells(xlCellTypeConstants).Font.Color = vbBlue
End With
On Error GoTo 0
End Sub