G
Guest
Hello,
I am writing c# web application with Excel 2000.
My code is:
Excel.Application EXL;
EXL = new Excel.Application();
Excel.Worksheet WSheet = new Excel.WorksheetClass();
string FileName = MapPath(".") + "\\..xls";
WSheet = (Excel.Worksheet)EXL.Workbooks.Open(FileName, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing).Worksheets.get_Item(1);
Excel.Range rng = WSheet.get_Range("H12", Type.Missing);
string H12 = "H12: " + rng.Value2.ToString(); // Works fine
How can I assign value to cell?
rng.Cells[6, 3] = "a"; --> return the following error:
error: cannot assign '"a"' into 'rng.Cells[6,3]'
Thank you.
I am writing c# web application with Excel 2000.
My code is:
Excel.Application EXL;
EXL = new Excel.Application();
Excel.Worksheet WSheet = new Excel.WorksheetClass();
string FileName = MapPath(".") + "\\..xls";
WSheet = (Excel.Worksheet)EXL.Workbooks.Open(FileName, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing).Worksheets.get_Item(1);
Excel.Range rng = WSheet.get_Range("H12", Type.Missing);
string H12 = "H12: " + rng.Value2.ToString(); // Works fine
How can I assign value to cell?
rng.Cells[6, 3] = "a"; --> return the following error:
error: cannot assign '"a"' into 'rng.Cells[6,3]'
Thank you.