View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Wrapping a XLL as if it were a DLL

but after downloading the XL API from MS I found
that the version will build XLLs that will not run in XL2003,


I didn't even know about the "XL API", maybe you can get hold of VisualC++

I have a request, if I may be so bold. Do you have Access?


It's bust! But I tried in both Word and VB6, can't get it to work in either
of these. This is what I did, let me know if I missed something

- I already have a number of copies of xlcall32.dll (32kb v5.0) and placed
one in the same folder as the xll.

- I included the full path to the xll in the declaration, to double check I
ran in Excel with the CurDir NOT that of the xll, and as before it worked
fine. FWIW the xll was not 'loaded' in Excel like an addin. As before worked
fine.

Ran exact same code in both Word & VB6; in both I get Error 48 File not
found C:\path\whooperX.xll
Yes I'm sure the path is correct and ChDir to that of the xll makes no
difference.

Maybe you have an explanation ?


You realize that if this works you've just disproven MS's own
documentation? :-)


It wouldn't be the first time but I'm not sure. I couldn't get all the
functions in the xll to work. That may well be due to getting some parts of
the declaration wrong or due to the function itself. I couldn't for example
get this one to work -

//////////////////////////////////////////////////////////////
// Function by William Hooper www.whooper.co.uk
// 2d Lookup function
/////////////////////////////////////////////////////////////
LPXLOPER __stdcall Lookup2d( LPXLOPER xRange, LPXLOPER xRow, LPXLOPER xCol )

Also, William Whooper in his own demo file instructs to use Application.Run
in VBA

If the dll type declaration can be made to work I can well see the
attraction. Calling the simple xll function directly in a long loop vs
Application.Run was a fraction of a second vs a coffee break!

Regards,
Peter T



"Maury Markowitz" wrote in message
...
On Apr 8, 3:55 pm, "Peter T" <peter_t@discussions wrote:
Actually seems it is possible to declare an xll just like a dll after all

Sadly William Hooper's excellent site seems to have been terminated for
quite a while, but for anyone that has his demo functions (Anewxll) - I

did
this:


This is excellent news Peter, I can't thank you enough! I was trying
to test this myself, but after downloading the XL API from MS I found
that the version will build XLLs that will not run in XL2003, at least
not with modification. Very frustrating, as you might imagine.

I have a request, if I may be so bold. Do you have Access? If so,
could you try the exact same code in Access to see what happens? You
WILL need to use the xlcall32.dll and place it in the same directory
as the xll. You can find this on the 'net very easily. You will also
need to type in the full path to the XLL...

Declare Function Junk1 Lib "c:\myxlldir\whooperX.xll"...

You realize that if this works you've just disproven MS's own
documentation? :-)

Maury