Hello,
You could try the following code.
Uses Excel;
Excel.Application excelApp = new Excel.ApplicationClass(); // create a new
Excel Application instance
excelApp.Visible = false; // set this property to true if you want the
excel window to popup
Excel.Workbook newWorkbook = excelApp.Workbooks.Open("test.xls", 0, false,
5, "", "", false, Excel.XlPlatform.xlWindows, "", true, false, 0, true,
false, false);
//replace test.xls with your own workbook path
Excel.Sheets excelSheets = newWorkbook.Worksheets;
string currentSheet = "Sheet1";
Excel.Worksheet excelWorksheet =
(Excel.Worksheet)excelSheets.get_Item(currentSheet );
Excel.Range excelCell = (Excel.Range)excelWorksheet.get_Range("A1", "A1");
excelCell.Value2 = "Timesheet for weekending " + cmbWeekEnd.Text + " (" +
cmbDepartment.Text + ")";
excelCell.Font.Size = 12;
excelCell.Font.Bold = true;
Dont forget to add a reference to the excel object library and
Microsoft.Office.Core
Regards
Scott Blood
C# Developer
"nagen" <na***@suriamsc.com> wrote in message
news:er***************@TK2MSFTNGP10.phx.gbl...
I have an existing excel file & i would like to enter a specific value at
cell A1 in Excel2003 using asp.net 2.0 how can i do this?