Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VSTO unable to rename worksheet
Hello
I'me trying to rename several worksheets with the folowing code. When my worksheets are visible the renaming process throws an exception Excel.worksheet sheet = ... string oldName = sheet.Name; Excel.XlSheetVisibility visibility = sheet.Visible; // change name sheet.Visible = Microsoft.Office.Interop.Excel.XlSheetVisibility.x lSheetVisible; string newName = name + node.Attributes["suffix"].Value; sheet.Name = newName; sheet.Visible = visibility; the newName string is well formed and my code only breaks at instruction sheet.Name = newName; (error 0x800A03EC...) it all goes well when my sheet is originally veryhidden. when it is visible it sends an error i'me running out of ideas.. can anyone help me best regards Jorge |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VSTO unable to rename worksheet
SOLVED:
I first have to unprotect workbook structure... thanx anyway "Jorge Ribeiro" wrote: Hello I'me trying to rename several worksheets with the folowing code. When my worksheets are visible the renaming process throws an exception Excel.worksheet sheet = ... string oldName = sheet.Name; Excel.XlSheetVisibility visibility = sheet.Visible; // change name sheet.Visible = Microsoft.Office.Interop.Excel.XlSheetVisibility.x lSheetVisible; string newName = name + node.Attributes["suffix"].Value; sheet.Name = newName; sheet.Visible = visibility; the newName string is well formed and my code only breaks at instruction sheet.Name = newName; (error 0x800A03EC...) it all goes well when my sheet is originally veryhidden. when it is visible it sends an error i'me running out of ideas.. can anyone help me best regards Jorge |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VSTO Excel with Autoshapes, Connectors and Polylines on Worksheet? | Excel Programming | |||
No Worksheet Range Object in VSTO? | Excel Programming | |||
No Worksheet Range Object in VSTO? | Excel Programming | |||
Why would you be unable to rename an unprotected worksheet? | Excel Discussion (Misc queries) | |||
VSTO .net - Adding a Usercontrol unto Worksheet | Excel Programming |