Wrapping a XLL as if it were a DLL

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I have a XLL mathematical library that I call though Application.Run
in Excel. This is a MAJOR performance bottleneck, and I am trying to
see if I can call it directly though a wrapper instead. I found a
discussion of how to call a XLL as if it were a DLL using xlcall32.dll
on the net, and have compiled this up and put the resulting dll into
the same directory as the XLL.

I then tried to wrap the XLL's function using Private Declare Function
inside Excel. However, this returns an error 53, File Not Found. I
tried adding the complete path to the XLL, but this had no effect.
This leads me to believe the error is misleading, and that it may mean
"dll not registered"?

Question1: Should I be able to use a complete path to find any dll no
matter if they are reged or not?

So then I tried registering the XLL, but this returns "LoadLibrary
failed. GetLastError returns 0x000036b1. According to the very few
hits on the 'net, this too is a completely generic message of dubious
value.

Question 2: Can an XLL be registered? As I understand it, XLL's are a
strict superset of DLLs.

Maury
.



Relevant Pages

  • Re: Excel XLL versus DLL
    ... So the general recommendation is to use XLL when you need very fast ... I have been writing Excel DLL. ...
    (microsoft.public.excel.programming)
  • Re: Calling an XLL from VB?
    ... You would call the XLL same as you would a DLL by putting in a declaration. ... you look at the vba help on the run command in Excel VBA. ... can call Application.Run on methods in other VBA programs, ...
    (microsoft.public.excel.programming)
  • Re: How do you make a variable persist in memory?
    ... How have you achieved this in VBA? ... But, from your description of the VBA, it sounds as though it may be you simply load a C# DLL into Excel and it remains loaded for each execution. ... You just keep calling the DLL. ... And what's "wrapped in an XLL"? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Wrapping a XLL as if it were a DLL
    ... I'm not sure you can declare xll functions as if a dll. ... If you have the project files maybe you can rebuild as a dll and use Declare ... Or Variant()? ...
    (microsoft.public.excel.programming)
  • Re: How Do I Use an XLL Add-In Function from Code?
    ... To use an XLL function, ... I'm writing VB code for a client. ... deliver their function to me in the form of a DLL. ... tried adding a reference to the XLL file, ...
    (microsoft.public.excel.programming)