Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong addin version loaded #10

Open
msz opened this issue Jun 9, 2017 · 4 comments
Open

Wrong addin version loaded #10

msz opened this issue Jun 9, 2017 · 4 comments

Comments

@msz
Copy link

msz commented Jun 9, 2017

One of our test Excel versions is:
image

The installation of the addin fails with the following error:

The file format and extension of the file don't match. 
The file could be corrupted or unsafe. 
Unless you trust its source, don't open it. 
Do you want to open it anyway?

Looking at the old VBScript installer, it seems that the 64 bit version is being incorrectly chosen. The logic is this:

if Mid(excel.ProductCode, 21, 1) = "0" then
    addInFile = addInFile & "\OpenFin.ExcelApi-AddIn.xll"
else
    addInFile = addInFile & "\OpenFin.ExcelApi-AddIn64.xll"
end if

I assume it's similar in the EXE installer. However, our excel.ProductCode is {9AC08E99-230B-47e8-9721-4577B7F124EA}, so 64 bit is chosen, even though the Excel is 32 bit.

@nicholasdgoodman
Copy link
Contributor

The VBS and .EXE installer make the 32-bit / 64-bit determination based upon the following documentation provided by Microsoft:

Can you verify the output that is generated from running the following VBA Macro within Excel:

Sub GetProductCode()

Debug.Print Application.ProductCode

End Sub

@msz
Copy link
Author

msz commented Jun 13, 2017

I don't seem to be able to open VBA Editor in that Excel - the button is greyed out. However, the product code I gave you comes directly from the installer script - I added a print statement within it. Running your macro in another version of Excel 2016 gives {90160000-000F-0000-0000-0000000FF1CE}, which is the same as the output from that print statement in the installer script. So I'm pretty sure the Application.ProductCode for the Excel that does not work is {9AC08E99-230B-47e8-9721-4577B7F124EA}.

@nicholasdgoodman
Copy link
Contributor

The GUID you have supplied appears show up in the registry (on my machine, at least) as the value:
PackageGUID

for the following key:
HKLM\SOFTWARE\Microsoft\Office\ClickToRun

Having only brief exposure to the MS Office Click-to-Run feature my suspicions are that the machine in question has not performed a full install of Excel, but rather currently has a partial install, with specific features such as VBA automation missing.

@msz
Copy link
Author

msz commented Jun 14, 2017

A proper reinstall fixed the issue, so you were probably correct. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants