Author Topic: Recent Error: Not a valid addin  (Read 11287 times)

newbie73

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Recent Error: Not a valid addin
« on: June 29, 2010, 07:11:43 AM »
Recently, I have been unable to open the pyxll.xll addin - Excel 2007 says it is of the type specified by the extension. When I continue to open the addin, it appears that the binary file is opened in Excel as if it were a text file.

When opening in Excel 2003, Excel complains that it is not a valid addin. I have tried to clear out my addins folder and downloading a new copy, though this also did not work. Any ideas what may be going on?

Tony

  • Administrator
  • Hero Member
  • *****
  • Posts: 574
  • Karma: +13/-1
    • View Profile
Re: Recent Error: Not a valid addin
« Reply #1 on: June 29, 2010, 07:29:58 AM »
Hi,

yes, that happens if Excel can't load any of the dll dependencies. You need to make sure you have the correct version of python installed to match the version of PyXLL you've downloaded. python2x.dll must be in your path (by default it's in C:\Windows\System32). You can also put it in the same directory as your addin if you don't want it in your path for any reason.

Regards,
Tony.

newbie73

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Recent Error: Not a valid addin
« Reply #2 on: June 29, 2010, 08:48:56 AM »
I have Python 2.6.4 installed with the Enthought Python Distribution - would this be a problem?

Tony

  • Administrator
  • Hero Member
  • *****
  • Posts: 574
  • Karma: +13/-1
    • View Profile
Re: Recent Error: Not a valid addin
« Reply #3 on: June 30, 2010, 08:02:30 AM »
Hi,

that should be fine, as long as you have downloaded the version of PyXLL built for python 2.6. PyXLL works with the Enthought distribution. You should check that the python dll is in your path though. You could also try copying it to the same folder you have the pyxll addin.

You could use a tool like depends.exe (http://www.dependencywalker.com) to see if there are any other dll dependencies missing. A couple of dlls may be missing, xlcall32.dll and ieshims.dll. These will be provided by Excel, so it doesn't matter they're not found. If there is anything else missing though, that will probably be the problem.

Regards,
Tony.

Glauco

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Recent Error: Not a valid addin
« Reply #4 on: October 28, 2011, 09:00:16 AM »
Hi Tony, i'm having  the same problem and i spent a lot of time searching with dependencywalker the problem.

First impression: windows dll hierarchy is a true hell!

Second, i found nothing interesting.

Where to search now?


Thank you
Glauco

Tony

  • Administrator
  • Hero Member
  • *****
  • Posts: 574
  • Karma: +13/-1
    • View Profile
Re: Recent Error: Not a valid addin
« Reply #5 on: November 01, 2011, 08:41:01 AM »
Hi Glauco,

yes, dlls in windows are a pain, especially with the side-by-side assemblies.

Did you manage to find the missing dll using dependency walker? Another possibility is if you can load python normally you can look at the loaded dlls to find where it finds the dll Excel can't find. You can use the sysinternals process explorer to do that (www.sysinternals.com or live.sysinternals.com/procexp.exe).

In almost all cases it's the microsoft runtime it can't find - msvrt90.dll.

Please let me know if you need more help to resolve this.

Best regards,
Tony

Tony

  • Administrator
  • Hero Member
  • *****
  • Posts: 574
  • Karma: +13/-1
    • View Profile
Re: Recent Error: Not a valid addin
« Reply #6 on: November 01, 2011, 08:48:56 AM »
One other thing - PyXLL is 32 bit and won't work with the 64 bit version of Excel. That would be another reason for getting this problem.

Regards,
Tony

Glauco

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Recent Error: Not a valid addin
« Reply #7 on: November 11, 2011, 12:48:55 PM »
Hi Tony, thank's for your interest.

I spent other time over this issue but i cannot find nothing.
I've tryed to analyze dependencies with PE Explorer Dependency scanner, dependency walker and process explorer.
Nothing appears strange to me ( or probably i don't know where to find solution)

I'm using excel 2003 in 32bit, but this issue appears in 2010
All environment is stand alone in a USB key with portable python 2.7

But at each reload of excel it cannot find a valid addins.
If you can install examples into a portable python env probably you can see the same problem.

Thank's
Glauco

Tony

  • Administrator
  • Hero Member
  • *****
  • Posts: 574
  • Karma: +13/-1
    • View Profile
Re: Recent Error: Not a valid addin
« Reply #8 on: November 12, 2011, 09:28:13 PM »
Hi Glauco,

could you try something for me please? Could you run Excel 2010 without loading PyXLL and have a look at what dlls are loaded using procexp.exe from sysinternals? (http://live.sysinternals.com/procexp.exe).

I'm particularly interested to see where it's loading msvcr90.dll from. In process explorer, click View->Lower Pane View->DLLs to show the dlls loaded by a process. Select EXCEL.EXE and then find msvcr90.dll from the list below and double click it. That should bring up the properties and will tell you where it's loaded from.

For me, it is here:
C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcr90.dll

This dll is also used by Python. In previous version of Excel, Excel itself used a different runtime dll but with Excel 2010 it happens to be the same version that python requires.

You could use process explorer to see what dlls Excel 2003 has loaded when using PyXLL as well, just to double check it is picking up the python dlls you expect it to.

I have installed portable python and removed all previously installed versions of python 2.7 to try and reproduce this problem. I set the following environment variables:

PATH=C:\PortablePython\App
PYTHONPATH=C:\PortablePython\App\Lib;C:\PortablePython\App\DLLs;C:\PortablePython\App\Lib\lib-tk

After doing that I have not been able to find any problems using PyXLL with portable python with Excel 2010 I'm afraid, so there must be something different happening in your case that we need to identify :(

Best regards,
Tony

Glauco

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Recent Error: Not a valid addin
« Reply #9 on: November 14, 2011, 12:22:04 PM »

I'm trying to run all environment without users need to modify environment. Because most of our user don't have admin permissions.

I've a suite directory within portable-python app dir.
Inside it will be installed the pyxll dll and all functions extension.

When pyxll start, it find python27.dd in current directory so all work well (in theory).


EXCEL standalone uses msvcr80.dll:
C:\Windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4927_none_d08a205e442db5b5\msvcr80.dll


When i add the pyxll addins he load msvcr90.dll
C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4926_none_508ed732bcbc0e5a\msvcr90.dll

I've done some try using link, copying these file in dir covered by PATH, but no results.


Thank you
Glauco







Tony

  • Administrator
  • Hero Member
  • *****
  • Posts: 574
  • Karma: +13/-1
    • View Profile
Re: Recent Error: Not a valid addin
« Reply #10 on: November 14, 2011, 10:21:41 PM »
Hi Glauco,

are you sure Excel 2010 is using msvcr80.dll? What version of 2010 are you using? You can find the version number by going to File->Help and it's on the right hand side, e.g. "14.0.6112.5000 (32-bit)".

Best regards,
Tony

Tony

  • Administrator
  • Hero Member
  • *****
  • Posts: 574
  • Karma: +13/-1
    • View Profile
Re: Recent Error: Not a valid addin
« Reply #11 on: November 14, 2011, 11:07:50 PM »
Hi Glauco,

another thing that occurred to me is how did you install Excel 2010? Was it from an msi, or did you use the click-to-run version (which is the default if installing from the web).

The click-to-run version doesn't support addins, and so PyXLL won't work with it. The solution recommended by Microsoft is to re-install using the msi version:
http://office.microsoft.com/en-us/excel-help/learn-more-about-office-click-to-run-HA010382090.aspx

Sorry for not remembering this before. It doesn't usually come up as most companies use some sort of package management/distribution that uses the msi - but perhaps this is your problem?

Best regards,
Tony

Glauco

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Recent Error: Not a valid addin
« Reply #12 on: November 15, 2011, 11:11:13 AM »
I'm using 2003  (11.8341.8341) SP3

Dunno how it is installed because PC are preconfigured by our ICT.
But is this is relevant i can ask this .


Thank you
Glauco

Tony

  • Administrator
  • Hero Member
  • *****
  • Posts: 574
  • Karma: +13/-1
    • View Profile
Re: Recent Error: Not a valid addin
« Reply #13 on: November 15, 2011, 11:38:55 AM »
Hi Glauco,

I thought you were having problems with 2010?

Please can you clarify exactly what version is not working for you?

thanks,
Tony

Glauco

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Recent Error: Not a valid addin
« Reply #14 on: November 17, 2011, 06:42:28 PM »
These are my test versions.

2003  (11.8341.8341) SP3
2003  (11.8332.8333) SP3
2010  (14.0.4760.1000) 32bit
2010  (14.0.6112.5000) 32bit

For all i've the same problem.

Thank you
Gla