problem with solver DLL load and Excel 2010

Answered problem with solver DLL load and Excel 2010

  • 2012년 8월 17일 금요일 오후 1:24
     
     

    Since upgrading from Office 2007 to Office 2010 we've started to experience a problem with the solver addin when our own analytics addins is also loaded. I have found a solution, but I think it may highlight a problem with the latest version of the solver addin for Excel 2010.

    Firstly, to describe the problem - the solver addin seems to load normally when Excel 2010 starts up, however when a "Solve" is performed we are seeing a "File not found: Solver32.dll" error at the final "Keep Solver Solution" stage. This only happens our own analytics addin is loaded. We've been careful to make sure that our own addin does not change the working directory and also that it has been built against the correct Excel 2010 SDK libraries. We do not see this error with any other versions of Excel running on the same PC or any other environment.

    After some searching we found other people were having similar problems and after a bit more probing I found a solution that works - but that I'm not very happy with.

    If I copy the Solver32.dll from:

      C:\Program Files (x86)\Microsoft Office\Office14\Library\SOLVER
        (where it was installed)

    into :

      C:\Windows\SysWOW64 
        (where Windows 7 keeps its 32 bit system DLLs)

    then the problem goes away.

    This seems to indicate that somehow Office 2010 has a problem that causes it to search in the wrong folder for the Solver32.dll when another addin is loaded in between the original Solver32.XLAM at start up and the use of the Solver in the sheet (which eventually requires this DLL to be loaded). Oddly, this only happens after a solution is found and "Keep Solver Solution" is selected - and I'm not sure why it's not looking for Solver32.dll any earlier.

    This is not a problem with any earlier versions of Excel and I suspect is a bug in the Office14/LIBRARY/SOLVER implementation. Is there any way to get this followed up?

    Thanks,

    Andy

모든 응답

  • 2012년 8월 20일 월요일 오전 9:23
    중재자
     
     

    Hi,

    Since you said that “This only happens our own analytics addin is loaded.” So I don’t think this is a bug. And I think maybe this issue caused by any other add-ins.

    So we can try to open the file in safe mode to check the issue:

    http://social.technet.microsoft.com/Forums/en-US/excel/thread/cd010692-aac1-4ced-9bfa-37ff85dc3e2f

    If the issue will not occur when the file opened in safe mode, then it means that there are some add- ins causing the issue.


    Jaynet Zhang

    TechNet Community Support

  • 2012년 8월 27일 월요일 오후 6:56
     
     

    I'm facing the same issue. With an Excel VSTO add-in we're building. When the add-in is enabled the assembly solver32.dll can't be found. With our add-in disabled the DLL is resolved as (Sysinternals Process Monitor trace):

    EXCEL.EXE CreateFile C:\Program Files (x86)\Microsoft Office\Office14\Solver32.dll
    EXCEL.EXE CreateFile C:\Windows\SysWOW64\Solver32.dll
    EXCEL.EXE CreateFile C:\Windows\system\Solver32.dll
    EXCEL.EXE CreateFile C:\Windows\Solver32.dll
    EXCEL.EXE CreateFile C:\Program Files (x86)\Microsoft Office\Office14\Library\SOLVER\SOLVER32.DLL

    and with our add-in enabled the following locations are tried, but solver32.dll won't be found:

    excel.exe CreateFile C:\Program Files (x86)\Microsoft Office\Office14\Solver32.dll
    excel.exe CreateFile C:\ArcGIS\______path to our add-in install location_____________\Solver32.dll
    excel.exe CreateFile C:\Windows\SysWOW64\Solver32.dll
    excel.exe CreateFile C:\Windows\system\Solver32.dll
    excel.exe CreateFile C:\Windows\Solver32.dll
    excel.exe CreateFile C:\Program Files\Common Files\Microsoft Shared\Windows Live\Solver32.dll
    excel.exe CreateFile C:\Program Files (x86)\Common Files\microsoft shared\Windows Live\Solver32.dll
    excel.exe CreateFile C:\Windows\SysWOW64\Solver32.dll
    excel.exe CreateFile C:\Windows\Solver32.dll
    excel.exe CreateFile C:\Windows\SysWOW64\wbem\Solver32.dll
    etc...

  • 2012년 8월 30일 목요일 오전 9:34
     
     답변됨

    In the end I got to the bottom of this and it's all about SetDllDirectory and how you can no longer use this call in your addin without upsetting the lastest Office 2010 Solver addin release - regardless if you addin is loaded before or after Solver. When I removed the SetDllDirectory call from our addin the problem went away.

    The solver addin has been changed in the latest release for Office 2010 such that it delay loads Solver32.dll in a relative way without being sure that the search path is set correctly - this was not the case with the prior version!

    People who have fixed this issue by copying Solver32.dll into the windows system area have just found a kludge that forces this dll into the search path.

    IMO the issue above need to be addressed by Microsoft as it is clearly causing people problems.

    In the meantime we will code out our dependency on SetDllDirectory.

    I hope this helps someone else!

    Andy

    • 답변으로 표시됨 andyr88 2012년 8월 30일 목요일 오전 9:34
    •