kabi.ganesh
New Member
- Joined
- Oct 2, 2012
- Messages
- 7
Hi Guys,
I back again requesting your help.
My objective is:
I have a dll file, code written in C++ (i guess so) and compiled. I have no idea what is coded in there.
I have to access this dll from my VBA code, get the result from the dll. My input for the dll is 3 integer values which are in a excel sheet.
1. I have declared the dll like this (... three dot is just window dir)
<CODE>
Public Declare Function quadratic Lib "C:\...\Desktop\Test\quadratic.dll" (ByVal a As Integer, ByVal b As Integer, ByVal c As Integer) As Double
</CODE>
2. On a button click, I read the input values a,b,c from the sheet and call the function passing the arguments like
getvalue = quadratic(a, b, c)
but I get Microsoft Visual Basic error saying
"Run-time error '48': File not found: C:\...\Desktop\Test\quadratic.dll"
After this I tried to reference this dll using Tools->Reference->Browse and then mapping the dll file kept on my desktop, I get a Microsoft Visual Basic for Application error saying
Can'd add a reference to the specified file.
I have no clue how to solve this. I tried various ways by changing the VB code, but no joy.
Please help me at the earliest as it is very urgent.
Regards,
Kabilan<CODE></CODE>
I back again requesting your help.
My objective is:
I have a dll file, code written in C++ (i guess so) and compiled. I have no idea what is coded in there.
I have to access this dll from my VBA code, get the result from the dll. My input for the dll is 3 integer values which are in a excel sheet.
1. I have declared the dll like this (... three dot is just window dir)
<CODE>
Public Declare Function quadratic Lib "C:\...\Desktop\Test\quadratic.dll" (ByVal a As Integer, ByVal b As Integer, ByVal c As Integer) As Double
</CODE>
2. On a button click, I read the input values a,b,c from the sheet and call the function passing the arguments like
getvalue = quadratic(a, b, c)
but I get Microsoft Visual Basic error saying
"Run-time error '48': File not found: C:\...\Desktop\Test\quadratic.dll"
After this I tried to reference this dll using Tools->Reference->Browse and then mapping the dll file kept on my desktop, I get a Microsoft Visual Basic for Application error saying
Can'd add a reference to the specified file.
I have no clue how to solve this. I tried various ways by changing the VB code, but no joy.

Please help me at the earliest as it is very urgent.
Regards,
Kabilan<CODE></CODE>
Last edited by a moderator: