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

  • Home
  • SEARCH
  • 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 8050921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:11:27+00:00 2026-06-05T07:11:27+00:00

For the current code: String currentPath = Directory.GetCurrentDirectory(); OpenFileDialog op = new OpenFileDialog(); op.InitialDirectory

  • 0

For the current code:

 String currentPath = Directory.GetCurrentDirectory();

        OpenFileDialog op = new OpenFileDialog();
        op.InitialDirectory = currentPath;
        if (op.ShowDialog() == DialogResult.OK)
            currentPath = op.FileName;
        else
        {
            toolStripStatusLabel1.Text = "Failed to Load Workbook";
            toolStripStatusLabel1.Visible = true;
        }

        Workbook wb = new Workbook(excel.Workbooks.Open(currentPath));

I recieve the error:

System.Runtime.InteropServices.COMException was unhandled
Message=Retrieving the COM class factory for component with CLSID {00020819-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
Source=mscorlib
ErrorCode=-2147221164

All I want is a predefined workbook to add worksheets to

  • 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-06-05T07:11:28+00:00Added an answer on June 5, 2026 at 7:11 am

    I suppose that in your code the fullname of Workbook is Microsoft.Office.Interop.Excel.Workbook, and that excel is an instance of Microsoft.Office.Interop.Excel.Application.

    If this is the case your code can’t work because Workbook is an interface, and interfaces do not have constructors. You have to ask the excel application to create the workbooks for you, and in your case you have to simply write:

    Workbook wb = excel.Workbooks.Open(currentPath); 
    

    In a similar way, if you want to create a new empty workbook, you should write:

    Workbook wb = excel.Workbooks.Add(System.Reflection.Missing.Value);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: string filterTerm = txtDocFilterTerm.Text.ToLower(); var regEx = new Regex(filterTerm);
This is my current code: public void copy(String file, String region) throws FileNotFoundException, IOException{
My current best code is: string delNonQuery = DELETE FROM + Settings.DataSource + WHERE
Alright, this is my current code snippet: namespace bai = boost::asio::ip; bai::tcp::socket tcp_connect(std::string hostname,
This is my current code: #include <list> #include <string> using std::string; using std::list; int
Current code: public static void WhoIsOnline(string worldName, WhoIsOnlineReceived callback) { string url = http://www.tibia.com/community/?subtopic=worlds&world=
Here's my current code: public class MallMapActivity extends Activity { private final static String
My current code is: for(int i=0;i<jArray.length();i++){ JSONObject json_data = jArray.getJSONObject(i); String b = json_data.getString(examnames);
Current source code: string itoa(int i) { std::string s; std::stringstream out; out << i;
current code I've built function to do something over collection of jQuery elements: var

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.