how to convert COM Object to string in asp.net web application
-
we are using microsoft Office 9.0 Library & COM namespace is OWC TextBox1.Text = xlsheet.ActiveSheet.Cells[i,1]; While writting this code it is not converting to object to string but in reverse case it is working properly uploading to spreadsheet. //This is the Error Error: Cannot convert Object to String So pls convey this & let me know the solution for the above problem. I m using asp.net with c# coding. Thanking u, Naren. please help me
-
we are using microsoft Office 9.0 Library & COM namespace is OWC TextBox1.Text = xlsheet.ActiveSheet.Cells[i,1]; While writting this code it is not converting to object to string but in reverse case it is working properly uploading to spreadsheet. //This is the Error Error: Cannot convert Object to String So pls convey this & let me know the solution for the above problem. I m using asp.net with c# coding. Thanking u, Naren. please help me
-
we are using microsoft Office 9.0 Library & COM namespace is OWC TextBox1.Text = xlsheet.ActiveSheet.Cells[i,1]; While writting this code it is not converting to object to string but in reverse case it is working properly uploading to spreadsheet. //This is the Error Error: Cannot convert Object to String So pls convey this & let me know the solution for the above problem. I m using asp.net with c# coding. Thanking u, Naren. please help me
-
we are using microsoft Office 9.0 Library & COM namespace is OWC TextBox1.Text = xlsheet.ActiveSheet.Cells[i,1]; While writting this code it is not converting to object to string but in reverse case it is working properly uploading to spreadsheet. //This is the Error Error: Cannot convert Object to String So pls convey this & let me know the solution for the above problem. I m using asp.net with c# coding. Thanking u, Naren. please help me
-
TextBox1.Text = xlsheet.ActiveSheet.Cells[i,1].ToString(); Every object in .NET has a
.ToString()
method -- modified at 7:45 Friday 21st April, 2006Hi Thanks for sending Reply. TextBox1.Text = xlsheet.ActiveSheet.Cells[i,1].ToString(); & also TextBox1.Text = (string)xlsheet.ActiveSheet.Cells[i,1]; But i used this, its not working. Pls give any idea. Once again Thanking u, Naren please help me
-
All solutions are incorrect. Correct code:
Excel.Range cell = (Excel.Range)m_workSheet.Cells[x + 2, y + 1]; string st = cell.Text.ToString();
Best regards, Alexey.Hi Alexey Thanks a lot for immediate reply. Its giving an exception as "Specified Cast is not valid". Now i m getting this problem. Thanking u, Naren please help me
-
Hi Alexey Thanks a lot for immediate reply. Its giving an exception as "Specified Cast is not valid". Now i m getting this problem. Thanking u, Naren please help me
I hardly ever do Office Interop, but the Cell[,] returns a Cell, which has, IIRC, a Value property, soooo...
TextBox1.Text = xlsheet.ActiveSheet.Cells[i,1].Value.ToString();
might be what you're looking for, or something very close to it. Dave Kreskowiak Microsoft MVP - Visual Basic