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

xlpython32-2.0.6.dll not found #36

Closed
jcanoj opened this issue Nov 20, 2014 · 15 comments
Closed

xlpython32-2.0.6.dll not found #36

jcanoj opened this issue Nov 20, 2014 · 15 comments
Milestone

Comments

@jcanoj
Copy link

jcanoj commented Nov 20, 2014

Hi Eric!

I'm following the tutorial and I'm facing a problem. When I click the "import python UDFs" I get a run-time error '53', file not found xlpython32-2.0.6.dll. I'm using windows xp 64bits with a portable version of python, the file xlpython32-2.0.6.dll is inside the folder xlpython. The folder structure is like this (the brackets are just for clarification)

My Documents
|--py_excel (folder)
|--testpy.xls
|--testpy.py
|--xlpython (folder)
|--init.py
|--fix_anaconda_pywin32.py
|--xlpyserver.py
|--xlpython (bas file)
|--xlpython.cfg
|--xlpython32-2.0.6.dll
|--xlpython64-2.0.6.dll
|--xlpython_v1back

The add-in is installed in c:\PortableApps\excelpython and python 2.7.6 is in C:\PortableApps\WinPython-32bit-2.7.6.4\python-2.7.6. The python path is added to the PATH variable (from a cmd windows I can run python) through a user variable.

I have not change the xlpython.cfg file.

Don't know if is of interest: I've checked the excel macro (automatically created by the add-in) and the XLPyLoadDLL works correctly and yes: the right path/file is passed to LoadLibrary. And, finally, everytime that I load the testpy.xls, the add-in complains that the file is not ready and I have to launch the "Setup ExcelPython" macro.

Thanks in advance for your help!

@ericremoreynolds
Copy link
Owner

Ok so last thing first -- yes because of how it's set up at the moment, because there's an error the add-in thinks the workbook simply hasn't been set up. But the DLL loading thing is the real problem.

Could you please check if the version of Office you have installed is 32 or 64-bit? (see here for instructions on how to do find out).

Presumably you have 32-bit office, if ExcelPython is trying to load xlpython32-2.0.6.dll, but if that's not the case then this may be the reason why it's failing.

Thanks!

Best regards,

Eric.

@jcanoj
Copy link
Author

jcanoj commented Nov 21, 2014

Hi, Eric.

Thanks for the quick answer. It is Office 2007, 32bit version.

@ericremoreynolds
Copy link
Owner

Ok, well it's very difficult to diagnose because it should all work correctly. I haven't tried the 64bit OS + 32bit Excel combination myself, as you can understand it's difficult to test all possible combinations of OS/Office. The version of Python should be irrelevant, since a separate process is launched by the DLL and in any case it happens after the DLL is loaded.

If you're willing to spend a bit of time trying to figure out what's going on, one thing we can try is:

  • modify the XLPyLoadDLL function as follows:

    Sub XLPyLoadDLL()
        Dim result, error
        result = LoadLibrary(XLPyFolder + "\" + XLPyDLLName)
        error = Err.LastDllError
    End Sub

    and put a break point on End Sub

  • run XLPyLoadDLL

  • result should be set to zero, indicating an error and error should be a number which (hopefully) gives us more information on the error which occurred

@ericremoreynolds
Copy link
Owner

If, as I suspect, the error is 126 then you could try what is suggested here.

@jcanoj
Copy link
Author

jcanoj commented Nov 21, 2014

You are right: result is 0 and error is 126.

@ericremoreynolds
Copy link
Owner

Please also check out my guide to using Process Monitor in #2 (my comment with the screenshots).

@jcanoj
Copy link
Author

jcanoj commented Nov 21, 2014

It looks like that I need administrative rights to run Process Monitor; that could be a problem or at least, slow to solve. I'll see what it can be done and keep you informed if I can make any progress. Thanks for your help anyway and thanks for this plugin. I think it has a lot of potential.

@ericremoreynolds
Copy link
Owner

No, thank you for your time, I am sorry we haven't fixed the issue yet. Unfortunately loading DLLs in Excel is very sensitive to the machine setup. ExcelPython v2 was designed to minimize these problems, by making the DLL have the fewest dependencies possible, but evidently there are still some tricky edge cases.

Please let me know if you make any progress.

Best regards,

Eric.

@ericremoreynolds
Copy link
Owner

As a last resort you like you could try API Monitor instead of Process Monitor - maybe it doesn't need admin rights.

@jcanoj
Copy link
Author

jcanoj commented Nov 21, 2014

Yes, API Monitor works without admin rights. I'll give it a try

@jcanoj
Copy link
Author

jcanoj commented Nov 24, 2014

Hi again, Eric. I run API Monitor, but I'm not sure what I should be looking for. I have a csv, would you be so kind to have a look to it, please ? (I'm not sure how I could send it to you, github allows only PNG and JPG). Thanks for your help.

@ericremoreynolds
Copy link
Owner

Hello, please send it to me by e-mail, I have just added it to my GitHub profile.

@ericremoreynolds
Copy link
Owner

For the benefit of other users: after e-mail discussions it seems that the problem is to do with the ExcelPython DLL not finding the correct version and bitness of the the Microsoft Visual C++ Runtime.

One quick work-around is to copy the DLLs contained in this archive into the same folder as EXCEL.EXE (which should be in C:\Program Files\Microsoft Office\Office12 or some similar folder) and restart Excel.

I am considering statically linking the MSVCR into ExcelPython in future releases, so hopefully this problem no longer arises.

@ericremoreynolds ericremoreynolds added this to the v2.1 milestone Nov 26, 2014
@ericremoreynolds
Copy link
Owner

Hi Jesus,
this should be fixed in v2.0.8, if you have some time and decide to try it out, please let me know if it's working for you (having removed the msvcr100.dll and msvcp100.dll files you copied into the EXCEL.EXE folder of course).
Regards,
Eric.

@jcanoj
Copy link
Author

jcanoj commented Dec 4, 2014

working perfectly for me!

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