title: Unable to acess dll file from VBA Code. How to find issue with DLL?
body: <p>I have a problem referencing DLL with my VBA code.</p>
  
  <p><strong>My objective is:</strong> 
  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. </p>
  
  <p>I have declared the dll like this 
      Public Declare Function quadratic Lib "C:...\Desktop\Test\quadratic.dll" (ByVal a As Integer, ByVal b As Integer, ByVal c As Integer) As Double
  (... three dot is just window dir)</p>
  
  <p>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)</p>
  
  <ol>
  <li><p>I get Microsoft Visual Basic error when running the script, saying 
  "Run-time error '48': File not found: C:...\Desktop\Test\quadratic.dll"</p></li>
  <li><p>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.</p></li>
  <li><p>I tried to register the DLL using cmd prompt with command regsvr32 C:...\dllname.dll, which give below error
  "LoadLibrary("C:\Documents") failed - The specific module could not be found"</p></li>
  <li><p>I tried to register the DLL with 2nd method on cmd prompt with command rundll32.exe  C:...\dllname.dll, which give below error
  "Error Loading C:\Documents. The specific module could not be found"</p></li>
  </ol>
  
  <p>I have no clue how to solve this. I tried various ways by changing the VB code, but no joy. </p>
  
  <p>I need,
  1. How to reference it using VBA script?
  2. How to find the problem in DLL why I cant reference it in VBA?</p>
  
  <p>Please help me at the earliest as it is very urgent.</p>
  
  <p>Regards,
  Kabilan </p>