Rename Excel sheets after exporting to a new Excel spreadsheet
-
Hi, I have an application that exports data from a datagrid to an excel spreadsheet. The export works perfectly but I have been struggling to get code that renames the sheets from the default (Sheet1, Sheet2, etc) to the name that I want. Can someone help.
Mvelo Walaza Developer Telkom SA
-
Hi, I have an application that exports data from a datagrid to an excel spreadsheet. The export works perfectly but I have been struggling to get code that renames the sheets from the default (Sheet1, Sheet2, etc) to the name that I want. Can someone help.
Mvelo Walaza Developer Telkom SA
May be you can have a look on this http://support.microsoft.com/kb/316934[^] and this http://www.spreadsheetgear.com/support/help/spreadsheetgear.net.3.0/SpreadsheetGear~SpreadsheetGear.IWorksheets.html[^] hope this help you ;)
modified on Friday, April 18, 2008 9:24 AM
-
May be you can have a look on this http://support.microsoft.com/kb/316934[^] and this http://www.spreadsheetgear.com/support/help/spreadsheetgear.net.3.0/SpreadsheetGear~SpreadsheetGear.IWorksheets.html[^] hope this help you ;)
modified on Friday, April 18, 2008 9:24 AM
Hi, Thanx 4 the reply!! But what is a Spreadsheetgear? Below is the code that I use and it gives me an error: //create new worksheet Microsoft.Office.Interop.Excel._Application _appClass = new ApplicationClass(); _appClass.Visible = true; _appClass.Caption = "Exported ECS Errors"; Microsoft.Office.Interop.Excel.Workbook wbk = _appClass.Workbooks.Add(XlWBATemplate.xlWBATWorksheet); wbk.Worksheets["Sheet1"] = "Mvelo"; Please explain what the Spreadsheetgear is/provide me with a solution to this code.
Mvelo Walaza Developer Telkom SA