sql-bi/AnalyzeInExcel

COM Interop failed to connect the Excel file

didierterrien opened this issue · 12 comments

Hello Marco,
Testing V1.1.1 I notice Excel shows the dialog box in order to approve opening the ODC file. I double checked I use version 1.1.1. I checked also the connection which is actually made with the ODC file.
I deleted the ODC file but it was created again by your tool so I'm sure COM Interop failed.
Please let me know if you need more information
Thanks in advance
Didier Terrien

Hi Didier, I'm really glad you wrote because there are cases where COM Interop fails and we don't understand why.
Please, can you tell me:

  • what is the version of Excel you have
  • what is the content of this Registry hive: HKEY_CLASSES_ROOT\Excel.Application\CLSID (see the image below, you probably have a different GUID or you don't have that registry key)
  • what is the content of this Registry hive: HKEY_CLASSES_ROOT\Excel.Application\CurVer

I look forward to hearing from you!

image

image

Marco,

Here is the information:

  • Office standard 2013
  • CLSID = {00024500-0000-0000-C000-000000000046}
  • CurVer = Excel.Application.15

Feel free to ask for more
Didier

Do you know whether you have (or you have had) other versions of Excel?
For example: in the registry you might have a hive HKEY_CLASSES_ROOT\Excel.Application.15 bot also HKEY_CLASSES_ROOT\Excel.Application.14 and HKEY_CLASSES_ROOT\Excel.Application.12 - please, can you tell me which hives do you have?

Other question: can you check whether you have this hive in the registry:
Computer\HKEY_CLASSES_ROOT\CLSID{00024500-0000-0000-C000-000000000046}

If yes, can you provide the content of these registry keys:
Computer\HKEY_CLASSES_ROOT\CLSID{00024500-0000-0000-C000-000000000046}\ProgID
Computer\HKEY_CLASSES_ROOT\CLSID{00024500-0000-0000-C000-000000000046}\InprocServer32
Computer\HKEY_CLASSES_ROOT\CLSID{00024500-0000-0000-C000-000000000046}\InprocHandler32
Computer\HKEY_CLASSES_ROOT\CLSID{00024500-0000-0000-C000-000000000046}\VersionIndependentProgID

There seems to be a mismatch between the CLSID and the Excel version you have, but we need more details to understand what is going on. Technically, the tool finds that Excel.Application is available, but the COM Interop calls fails. The CLSID should be automatically identified by the Interop library, but on your machine it is not working. I would like to understand why because it's not the first time I see the issue reported by the telemetry, but it's the first time I have the ability to ask more details!

Thanks in advance!

Marco,
I have only HKEY_CLASSES_ROOT\Excel.Application.15
I have Computer\HKEY_CLASSES_ROOT\CLSID\{00024500-0000-0000-C000-000000000046} ("\" between CLSID and "{")

image

image

Ask for more if needed

Can you do the same for this hive in the registry:
Computer\HKEY_CLASSES_ROOT\CLSID{000208D5-0000-0000-C000-000000000046}

If you have it, can you provide the content of these registry keys (the screenshots you made before are perfect):
Computer\HKEY_CLASSES_ROOT\CLSID{000208D5-0000-0000-C000-000000000046}\ProgID
Computer\HKEY_CLASSES_ROOT\CLSID{000208D5-0000-0000-C000-000000000046}\InprocServer32
Computer\HKEY_CLASSES_ROOT\CLSID{000208D5-0000-0000-C000-000000000046}\InprocHandler32
Computer\HKEY_CLASSES_ROOT\CLSID{000208D5-0000-0000-C000-000000000046}\VersionIndependentProgID

Thanks!

I don't have the one you mentioned. Here is what looks the same :

image

Question: do you use DAX Studio?
If you create a Power Pivot model in Excel, does DAX Studio add-in works?
I would say that there is some issue in the Excel configuration and any COM Interop call is going to fail on your PC. However, I don't have evidence for that. It could also be some mismatch between 32-bit and 64-bit, even though I guess you have Excel 32-bit installed and this shouldn't be the case.

Another workaround is using an IDispatch based approach instead of the COM Interop one. We opted for COM Interop in v1.1, reverting to the ODC file if COM Interop fails. I think we could try this sequence:
COM Interop --> IDispatch --> ODC file

Let me know if you have other details we should take into account.
Thanks!

I do use DAX studio but not in Excel. I even don't have Power Pivot installed on my machine. DAX studio works very well in External tools.

If I launch Analyze in Excel from Power BI desktop and then click on DAX studio button in Excel, I get this error :
image

In Excel options, I noticed I have 2 DAX studio addins. One seems to be a debug version (may be coming from Visual Studio as I tried DAX studio source code from Github) :
image

Yes I use a 32bits version :
image

I will be available to test other approaches. Happy to provide some help.

If you don't have Power Pivot installed in Excel, the AddIn in Excel is not that useful (you don't have a Power Pivot model, as you see in the screenshot).
I'm sure the two add-ins are there because you installed one from Visual Studio.

I don't need other tests at the moment, I will update you as soon as we have something new to test.
Thanks!

Didier, please can you try this version?
https://cdn.sqlbi.com/updates/AnalyzeInExcel-1.1.2.msi

Let me know if it works - it should open the Excel file without creating the ODC file or not.
It tries to use IDispatch of COM Interop fails.
I look forward to hearing from you!

Thank you Marco,

It worked :
image

Great! Thanks for the prompt feedback, I'm going to publish this release soon because there are other people who had the same experience.