A
amit.nayar
I am trying set a string in a range programmatically using C#. Here's
the code:
string str = @"= (Beginning Stockholders' Equity + Ending
Stockholders' Equity) / 2";
range.Value2 = str;
Assume that range is a valid range. I don't want to bore you with all
the code, as showing you how to get a range from a spreadsheet seems
like useless information.
When I execute this code, I get the following exception:
System.Runtime.InteropServices.COMException : Exception from HRESULT:
0x800A03EC
I realize the string looks like a formula, and it is not a valid
formula, but why does this throw an exception? I'm able to type this
string into Excel. I've also tried to set the Range.Formula and the
Range.Value to no avail.
Any help would be great. Thanks in advance for your help.
Cheers,
Amit
the code:
string str = @"= (Beginning Stockholders' Equity + Ending
Stockholders' Equity) / 2";
range.Value2 = str;
Assume that range is a valid range. I don't want to bore you with all
the code, as showing you how to get a range from a spreadsheet seems
like useless information.
When I execute this code, I get the following exception:
System.Runtime.InteropServices.COMException : Exception from HRESULT:
0x800A03EC
I realize the string looks like a formula, and it is not a valid
formula, but why does this throw an exception? I'm able to type this
string into Excel. I've also tried to set the Range.Formula and the
Range.Value to no avail.
Any help would be great. Thanks in advance for your help.
Cheers,
Amit