473,651 Members | 2,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exception from HRESULT : 0x800A03EC --Please help me to fix this error

2 New Member
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 Workbooks.Open( ___,____, ). I am Beginner So kindly help me.

Here is the code:

String strConnection = "Provider=Micro soft.Jet.OLEDB. 4.0;" +
"Data Source=" + strpath + ";" + "Extended Properties=Exce l 8.0;";
OleDbConnection objconn = new OleDbConnection (strConnection) ;

if (objconn.State == ConnectionState .Closed)
{
objconn.Open();
}

Excel.Applicati on app = new Excel.Applicati on();

Excel.Workbook lworkbook = app.Workbooks.O pen(txtselect.T ext, Type.Missing, true, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);

lworkbook = app.ActiveWorkb ook;
Excel.Sheets lsheets = lworkbook.Works heets;
Excel.Worksheet lworksheet = (Excel.Workshee t)lsheets.get_I tem(1);
lworksheet.Name = "person12";

OleDbCommand cmd = new OleDbCommand();
OleDbDataAdapte r adp = new OleDbDataAdapte r("select * from person12", objconn);

adp.Fill(dt);
dataGridView1.D ataSource = dt;
objconn.Close() ;
Oct 3 '07 #1
0 1435

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

Similar topics

1
11234
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 Exception: System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC. at Excel._Chart.Export(String Filename, Object FilterName, Object Interactive)
3
7846
by: Lekyan | last post by:
I have problem setting the password for an ADAM user using C#. I used the SetPassword code given in the Microsoft page, changed several parameters, but ran into an exception. I wonder if other people have solved this problem. But I have searched Google groups for a couple days but still couldn't get a solution. I copied the code from: ...
0
4162
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 = appExcel.Workbooks.Open(fileExcel) wbook.PrintOut(fisrtPage, lastPage, , , "Acrobat Distiller", True, filePs) wbook.Close()
8
14494
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 wrong.....or do you have a suggestion for a better way.......I do know this method is quite slow. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
2
36967
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 following exception, when i run the tool in a machine which contains MS Office 2003. Exception raised: "Exception from HRESULT: 0x800A03EC" Note: Added "Microsoft Excel 11.0 Object Library" in the project reference.
0
4919
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 make sure the code runs first before I implement it into my application. The code is supposed to plot for X values: column A in excel and for Y values: column B in Excel. The code up to the point and including exporting the data to excel runs...
0
1810
by: hne | last post by:
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...
0
1466
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 Workbooks.Open(___,____, ). I am Beginner So kindly help me. Here is the code: String strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + strpath + ";" + "Extended Properties=Excel 8.0;"; ...
0
1214
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: B14,D14,F14,H14,J14,L14,N14,P14,R14,T14,V14,X14,Z14,AB14,AD14,AF14,AH14,AJ14,AL14,AN14,AP14,AR14,AT14,AV14,AX14,AZ14,BB14,BD14,BF14,BH14,BJ14,BL14,BN14,BP14,BR14,BT14,BV14,BX14,BZ14,CB14,CD14,CF14,CH14,CJ14,CL14,CN14,CP14,CR14,CT14,CV14,CX14,CZ14,DB14,DD14,DF14,DH14,DJ14,DL14,DN14,DP14 I...
1
16398
by: fadi980 | last post by:
Hi, I'm exporting a data set into excel file from an ASP.NET application (VS 2008). On my PC, i got everything working just fine. but on my client server i got the error ( Exception from HRESULT: 0x800A03EC ), and i found that the problem is in this call: wb.SaveAs(FPath, Excel.XlFileFormat.xlXMLSpreadsheet, Type.Missing, Type.Missing, false, false, Excel.XlSaveAsAccessMode.xlNoChange, Type.Missing, Type.Missing, Type.Missing,...
0
8357
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8277
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8803
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7298
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2701
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1910
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1588
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.