Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 923419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:11:25+00:00 2026-05-15T19:11:25+00:00

I am using oledb connection string to import excel sheet. I am referencing 12.0

  • 0

I am using oledb connection string to import excel sheet. I am referencing 12.0 object libraries.
I tried with excel 2003 and 2007 both but getting same exception as below

Creating an instance of the COM component with CLSID {00020820-0000-0000-C000-000000000046} from the IClassFactory failed due to the following error: 80010001.

my code is

        txtpath.Text = fdlg.FileName;

        Excel.Worksheet worksheet = new Excel.Worksheet();
        Excel.Sheets sheets;
        Excel.Workbook theWorkbook;
        string SheetName;

        OleDbConnection conn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\"" + txtpath.Text + "\";Extended Properties=\"Excel 12.0 Xml;HDR=Yes;\";");
        conn.Open();

        Excel.Application ExcelObj = null;
        ExcelObj = new Excel.Application();

        theWorkbook = ExcelObj.Workbooks.Open(txtpath.Text, 0, false, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", true, true, 0, true, 1, 0);

        sheets = theWorkbook.Worksheets;

        worksheet = (Excel.Worksheet)theWorkbook.Worksheets.get_Item(1);
        SheetName = worksheet.Name.Trim();

        OleDbDataAdapter da = new OleDbDataAdapter("Select * FROM [" + SheetName + "$]", conn);
        DataSet ds = new DataSet();
        da.Fill(ds);

please help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T19:11:26+00:00Added an answer on May 15, 2026 at 7:11 pm

    It is a very low-level COM error, RPC_E_CALL_REJECTED, “Call was rejected by callee”. That doesn’t help much, but clearly Excel isn’t very happy with your code. A very good candidate is this statement:

     Excel.Worksheet worksheet = new Excel.Worksheet();
    

    Lose that, it doesn’t do anything useful. Creating the Application object first is always required.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this connection string to access excel(2007,2010) files oleConnection.ConnectionString = @Provider=Microsoft.ACE.OLEDB.12.0;Data Source= +
I am using OleDB to connect to an excel file using this connection string
This is the connection string I am using. string connection = Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\CULVERT2.DBF;Extended Properties=dBASE
I'm using the OleDbConnection class to retrieve data from an Excel 2000/2003 workbook: string
I'm trying to import a excel file with more than 256 columns using OLEDB
I'm using the OLEDB connection string for this and it appears that whenever I
I'm using the OleDB DataReader to get data from my excel files (but this
I am connecting to the excel file using ADO.NET OLeDB drivers. In the connection
I've been using an OleDb connection to read excel files successfully for quite a
I am parsing a CSV file using Jet with the connection string @Provider=Microsoft.Jet.OLEDB.4.0;Data Source=

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.