try { object oMissing = System.Reflection.Missing.Value; Microsoft.Office.Interop.Excel.ApplicationClass xl = new Microsoft.Office.Interop.Excel.ApplicationClass(); Microsoft.Office.Interop.Excel.Workbook xlBook; Microsoft.Office.Interop.Excel.Worksheet xlSheet; xlBook = (Microsoft.Office.Interop.Excel.Workbook)xl.Workbooks.Open(fileLocation, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing); xlSheet = (Microsoft.Office.Interop.Excel.Worksheet)xlBook.Worksheets.get_Item(1); xlSheet.Name = "New_LITM -" + 12; xlBook.Save(); xl.Application.Workbooks.Close(); } catch (Exception ex) { lblStatus.Visible = true; lblStatus.Text = ex.Message; lblStatus.ForeColor = System.Drawing.Color.Red; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)