Preeti

Preeti

  • NA
  • 2
  • 0

How to find the name of the Textbox in Excel via C#?

Aug 4 2007 11:59 AM
Can any one help me with this
1) I am trying to copy a string which has length greater than 255 characters in to a ExcelTextBOx.But it not working if i send 255 characters it working fine.
my code is like this
string temp;
Microsoft.Office.Interop.Excel.TextBox txtbox1=(Microsoft.Office.Interop.Excel.TextBox)workbook.TextBoxes("TxtboxName");
txtbox1.text=temp;
txtboxname is the name of the textbox on excel

2)I have one more question string in temp is from a Label on my webpage.It Has some text bolded .How to preserve the format on ExcelTextBox .

3)In the above code textbox1 is the name of the textbox on excel cell[1,1] but i have lot of textboxes on excel i cannot give names by myself,so my question is
How to find out the name of the textbox on a Excel cell from C# using
Microsoft.interop.office.excel libraries.




Please somebody help me with these i am trying for answers since so long.

Thanks
KU

Answers (1)