Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling function from C++ dll

Status
Not open for further replies.

kgarrett

Programmer
Aug 22, 2001
4
US
I have written a function in a C++ dll and I am trying to call it from VBA for Excel. I get the #value! error in Excel. I have read tutorials, talked to people, etc. I cannot see what the problem is. It really isn't a complicated function. Please provide possible solutions.


Kgarrett
 
I haven't used C++ dlls but maybe trying (in a code window) tools references and locating your dll. That way excel will have a reference to it.

Nick
 
Thanks. I tried that, but it said "can't add that file".
I have used the

Public Declare Function .... Lib "....\.dll"

line in VB. This should connect to the .dll. I am at a loss. Any other ideas??



Kgarrett
 
I am not too sure. I recently downloaded a ocx from the net and had to register it before I could use it (regsvr32.exe). But apart from that I cannot think of anything else. Sorry.

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top