473,387 Members | 1,588 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Exception from HRESULT: 0x800A03EC when I Select and object

1
Hi friends,
I have an application, written in C#, in which I am updating an Excel spreadsheet with data I pull from a sql database. When I try to select a cell in where I want to begin inserting my data I get the error -- Exception from HRESULT: 0x800A03EC (what does this mean?). I've searched the web and have been unsuccessful in finding a viable solution to the error. A snippet of my code is below:

Excel.Range cf = null;
// Create application object...
Excel.Application XcelApp = new Excel.ApplicationClass();
// I want to open an existing document for editing instead
// of creating a new one...
Excel.Workbook XcelWorkBook = XcelApp.Workbooks.Open(xlWorkBookPath,
0, false, 5, Type.Missing, Type.Missing, false,
Excel.XlPlatform.xlWindows, "", true, false, 0, true, false, false);

// initialize Excel objects...
Excel.Sheets XcelWorkSheets = XcelWorkBook.Worksheets;
Excel._Worksheet XcelWorkSheet = null;

// hide the app...
XcelApp.Visible = false;

Not ot bore anyone, but I open my workbook, locate and Activate my current worksheet; find the column I want and so on...
...
...
...

The error is when I try to select a specific location on my worksheet:


for (int i = 1; i <= dt.Rows.Count; i++)
{
curId = dt.Rows[i - 1].ItemArray[0].ToString();

if (counter.Equals(0)) row = 26; // next row...
if (counter.Equals(1)) row = 50; // ...
if (counter.Equals(2)) row = 74;
if (counter.Equals(3)) row = 98;

if (Int32.Parse(prvId) < Int32.Parse(curId)) // next row and so on...
{
This is where I get the exception
// It consistantly fails whenever counter is equal to 3.
XcelWorkSheet.Select(cellFound[row, col]);

prvId = curId; // current source id to previous source id
counter++;
...
... // do some more stuff...
}
}
Aug 30 '07 #1
0 1795

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Steven | last post by:
Hi there, I am trying to export a chart using the Excel11 object from C#. I can properly open workbooks and read cells, but calling Export() on the Chart object throws a COMException ...
0
by: e-lores | last post by:
I need to print an excel doc to PDF. I'm doing next until now 1.- First I print the file to PostScript format using 'Acrobat Distiller' printer Dim wbook As Excel.Workbook wbook =...
4
by: Mark | last post by:
I have a COM object that calls into a C# Forms library. The library can throw exceptions and I want to handle the exceptions in COM. Adam Nathan wrote a Microsoft sponsored book titled .Net and Com...
8
by: scorpion53061 | last post by:
Additional information: Exception from HRESULT: 0x800A03EC. This code produced this error. I am pretty sure I got this to run a while back and I was wondering if you all see anything I am doing...
2
by: Sai | last post by:
Hi, I have written a small tool for our internal purpose in VB.net. This tool reads data from logs and saves it in an excel file. This tool is working fine with MS Office 2000 but raising the...
5
by: Mikil | last post by:
I am communicating with Excel Interop dll using c#. The get_Range function throws an exception if the parameters are invalid. For e.g. get_Range("Mikil", Type.Missing); will crash if the "Mikil"...
0
by: rGh | last post by:
Hello, I am trying to create an Excel chart from C#. I am not a very experieced programmer, so my mistake could be very trivial. The code included is a very simple example. I just wanted to...
0
by: santu07 | last post by:
I am trying to export data from Excel11.0 object to datatable using C#. I can't properly open workbooks. Can anyone please help me to fix this error. I got the above error when i try to open the...
0
by: Stephen Plotnick | last post by:
I'm getting HRESULT: 0x800A03EC On this statement: cfDataBar = osheet.Range(RangeText).FormatConditions.AddDatabar with these values in RangeText:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.