Hi guys,
I would like to ask if it's possible to set a EXCEL cell property using C#.net. For example, I would like a certain cell format to DATE. Currently, my program can only set value and cell color, set wraptext. Below is my code snippet and hope you can give me idea.
//add data on a particular row
private void AddGetData(stri ng[] str, int sheet)
{
Excel.Sheets sh = m_wb.Sheets;
Excel.Worksheet ws = (Excel.Workshee t)sh[sheet];
string arow = m_row.ToString( );
string _row = "A" + arow + ":" + "M" + arow;
Excel.Range acell = ws.get_Range(_r ow, Type.Missing);
acell.Value2 = str;
//change the cell color in sheet1
_row = "A" + arow + ":" + "A" + arow;
ws.get_Range(_r ow, Type.Missing).I nterior.ColorIn dex = 38;
acell.
}
I would like to ask if it's possible to set a EXCEL cell property using C#.net. For example, I would like a certain cell format to DATE. Currently, my program can only set value and cell color, set wraptext. Below is my code snippet and hope you can give me idea.
//add data on a particular row
private void AddGetData(stri ng[] str, int sheet)
{
Excel.Sheets sh = m_wb.Sheets;
Excel.Worksheet ws = (Excel.Workshee t)sh[sheet];
string arow = m_row.ToString( );
string _row = "A" + arow + ":" + "M" + arow;
Excel.Range acell = ws.get_Range(_r ow, Type.Missing);
acell.Value2 = str;
//change the cell color in sheet1
_row = "A" + arow + ":" + "A" + arow;
ws.get_Range(_r ow, Type.Missing).I nterior.ColorIn dex = 38;
acell.
}
Comment