question

Joe S2 avatar image
0 Likes"
Joe S2 asked Ben Wilson edited

Flexsim Error Code -2147319765

Good Afternoon,

I've recently been getting an error code when I attempt to import data from excel in FlexSim.

1641848347466.png

I don't receive any errors other than the message seen in the attached image.

In other error messages that quote excel, the solution has typically been to uninstall and reinstall excel. I've tried this but it doesn't resolve the error.

Does anyone know what this error code means and how I can resolve it?

Thank you.

FlexSim 20.2.3
windowsexcel read errorflexsim errorcomregistry
1641848347466.png (4.5 KiB)
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·

If you search for this error code more in general and not alone for FlexSim, you will notice it is related to executing operations in excel sheets. Those operations can be initiated externally by program languages or internally by macros in excel workbook.

It may be also a conflict of different involved Bit versions like 32-bit FlexSim accessing 64-Bit Excel.
In other answers there were different versions of excel available and it wasn’t clear which version should be opened. Maybe on your machine there are remains of older excel installations still mangling with your currently last installation.

0 Likes 0 ·

1 Answer

·
Phil BoBo avatar image
2 Likes"
Phil BoBo answered Phil BoBo edited

If you search Answers for "failed to initialize excel", you'll find several questions and answers about this issue.

Search - About 5050 Results Found - FlexSim Community

The problem is an issue with how Excel is registered as a COM application with Windows. It is usually fixed by uninstalling and reinstalling Excel.

In the cases where uninstalling and reinstalling Excel doesn't fix the issue, it is usually caused by having multiple versions of different Office applications installed. For example, if you have OneNote 2016 installed and you are trying to communicate with Excel 2014. When FlexSim tries to launch an Excel instance, Windows looks for Excel 2016 because that's the latest Office path that has been registered, but then it can't find Excel 2016. The solution is usually to uninstall newer Office applications or install a newer Excel version that matches the latest Office applications that are installed.

The issue is happening within code that is not under direct FlexSim control. We create an "Excel.Application" instance, and the operating system determines what to do. The error message displayed is the error code that Windows is returning when trying to initialize an Excel instance. So the only answer I have right now is that you need to install/uninstall/repair Office applications until it works properly. There's nothing we can do about this error from the FlexSim side with the way the connection between FlexSim and Excel currently works.

It is on the development list to look into reading Excel workbook files directly without communicating with the Excel application via COM, but that functionality is a future possibility, not a current solution.

It looks like the involved registry keys for locating Excel might be:

HKEY_CLASSES_ROOT\Excel.Application\CLSID

Which references a key in HKEY_CLASSES_ROOT\WOW6432Node\CLSID\

On my machine, that key has an Excel path "C:\Program Files\Microsoft Office\Root\Office16\EXCEL.EXE" in the key value of HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{00024500-0000-0000-C000-000000000046}\LocalServer32

My guess is that Windows uses those registry keys to find Excel, and something in your registry isn't configured correctly to map the "Excel.Application" to the correct path to your installed Excel version.

The Microsoft Office installer should be generating and setting up all those registry key values. FlexSim simply asks for an instance of "Excel.Application".

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.