LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Can't add a reference to specified file


"Tom Ogilvy" wrote in message
...
If it is a xll/dll, I believe you would declare it just like a windows

API.
(rather than set a reference to it).

This article gives an example of making a DLL and calling it from VB

(should
be the same for VBA).

http://support.microsoft.com/default...46&Product=vbb

Include the path if it isn't in the system directory I believe.
HOWTO: Pass Optional Parameters to a C DLL Function from VB

--


Thanks Tom. Couldn't quite get it to work. So I'll post more info and
perhaps you or someone else could suggest the precise declaration to use.

1. Function Registering Table:
static LPSTR func[][14] = {
{ " getURL" , " RP" , " getURL" , " URL String" , " 1", " Transcend", " ", "
", " Non Volatile NOW()" , " This dummy dependency argument is unused inside
the funtion", " ", " ", " ", " "},
};

2. The DEF file snippet:
getURL


3. And here's the very ugly getURL function (but it works)

LPXLOPER __stdcall getURL(LPXLOPER inX) {
static XLOPER xRes;
Excel4(xlfNow, &xRes, 0); // Returns an xltypeNum;
xRes.xltype = xltypeStr;
xRes.val.str = (PUCHAR) " Input not a URL";
if (inX-xltype == xltypeStr) {
string *a = new string(" " + utilityURLToString(toStr(inX-val.str))); //
a function that uses the curl package compiled into the addin.
xRes.val.str = (PUCHAR) a-c_str();
xRes.val.str[0] = a-length() - 1;
xRes.xltype = xltypeStr;
}
return &xRes;
}


This works beautifully in worksheets and I want to have the function getURL
available in VBA!


Very many thanks!!! I would be exstatic if I can get this to work and I
think this will be useful to others as well!

(Hopeful) Bura



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking to another file using file reference typed cell Steven Excel Worksheet Functions 3 April 5th 08 03:15 AM
cross-reference data from one file to another file Zancouth Excel Discussion (Misc queries) 1 May 30th 06 11:25 AM
How do I reference external data from a file, file name found in . Clux Excel Discussion (Misc queries) 1 February 10th 05 10:52 PM
copy/paste from one file to another without file name reference slvrblt Excel Discussion (Misc queries) 4 February 6th 05 08:57 PM
reference to .dll file Claude Excel Programming 1 November 21st 03 03:34 PM


All times are GMT +1. The time now is 10:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"