0

Hi,

I am debugging an application developed by another programmer. AxInterop OCW11 excel component is used. The following code is giving an error "Input string was not in a correct format", "object reference was not set to an instance of an object".

strTest = axSpreadsheetASCIIop.ActiveCell.get_Range(
(Convert.ToChar(Col1)).ToString() + longRow1.ToString(), (Convert.ToChar(Col1)).ToString() + longRow1.ToString()).Value2.ToString();

The above piece is within a loop, just before the exception I see that strTest= " ..." something like that and next time it causes exception at the above line.

Any inputs will be helpful.

BTW this is in a C# windows application.

Thanks,
mrk

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by mrk
0

Debug is your friend.

You need to find the parts it puts together eg:
Convert.ToChar(Col1)).ToString();
longRow1.ToString(), (Convert.ToChar(Col1)).ToString() ;
longRow1.ToString();

and then the overrall

axSpreadsheetASCIIop.ActiveCell.get_Range(
(Convert.ToChar(Col1)).ToString() + longRow1.ToString(), (Convert.ToChar(Col1)).ToString() + longRow1.ToString()).Value2

0

Thank you. I was able to resolve this. I had to use :
axSpreadsheetASCIIop.ActiveSheet.Cells.get_Range instead of
axSpreadsheetASCIIop.ActiveCell.get_Range.

Thanks,
mrk

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.