Home » excel » F# Excel – error on new ApplicationClass

F# Excel – error on new ApplicationClass

Posted by: admin May 14, 2020 Leave a comment

Questions:

When I do just

type RExcel() = 
    let xlApp = new ApplicationClass()

I’ve got this Error :

Retrieving the COM class factory for
component with CLSID
{00024500-0000-0000-C000-000000000046}
failed due to the following error:
80040154 Класс не зарегистрирован (Class doesn’registered)
(Exception from HRESULT: 0x80040154
(REGDB_E_CLASSNOTREG)).

So maybe I can realize Excel read/write functions some another way.

Added : installed OpenOffice… Version of assembler is 14 … Maybe I need to use some another .NET library for Excel ?

How to&Answers:

I’m not sure I correctly understand your scenario, but if you want to call Excep using ApplicationClass, you need to have full Excel installed on your machine (and all users of your application will need to install Excel too). The library is just a wrapper that calls some internal functionality in Excel.

If you want to generate Excel files in F# directly, you can take a look at libraries that generate XLSX (new XML-based format) files. For example: http://epplus.codeplex.com/ This should be easy to use from F# and should not have any other requirements.