Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Exception from HRESULT: 0x800A03EC when setting string in Range.Value2 field
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Exception from HRESULT: 0x800A03EC when setting string in Range.Va
Hi, in my opinion there is no concatenation operator between the @ symbol and
the " symbol in the first line or you have placed the @ symbol outside " accidentally. Try fixing that. Also, in my opinion, ' symbol should be preceeded by a \ symbol to make it an ordinary string. I hope this helps you. " wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Exception from HRESULT: 0x800A03EC while binding values to a range | Excel Programming | |||
Exception from HRESULT: 0x800A03EC While opening Workbook | Excel Programming | |||
HRESULT: 0x800A03EC exception when trying to hide a sheet. | Excel Programming | |||
Exception from HRESULT: 0x800A03EC | New Users to Excel | |||
Chart.Export throws COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC. | Excel Programming |