Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception from HRESULT: 0x800A03EC while binding values to a range Jignesh Gandhi[_2_] Excel Programming 0 February 26th 07 07:36 PM
Exception from HRESULT: 0x800A03EC While opening Workbook Shreyash Excel Programming 0 February 7th 07 09:36 AM
HRESULT: 0x800A03EC exception when trying to hide a sheet. VVVVVK Excel Programming 1 August 25th 06 11:59 AM
Exception from HRESULT: 0x800A03EC nano2k New Users to Excel 0 July 21st 06 12:15 PM
Chart.Export throws COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC. Steven Excel Programming 1 November 5th 03 06:59 PM


All times are GMT +1. The time now is 06:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"