title: VBA code can't access to DLL in System32
body: <p>My VBA code can't access to my DLL in the C:\Windows\System32 folder on Windows 7 64bit and Word 2010 32bit.</p>
  
  <pre><code>Private Declare Function my_func Lib "mydll.dll" (ByVal param As String) As Long
  
  Public Sub MyFuncTest
    n = my_func("a")
  End
  </code></pre>
  
  <p>I copied mydll.dll into C:\Windows\System32 and called MyFuncTest but got an error message like "Error 53: 'mydll.dll' not found".</p>
  
  <p>However, I changed the declaration in code to:</p>
  
  <pre><code>Private Declare Function my_func Lib "C:\Users\myname\Documents\mydll.dll" (ByVal param As String) As Long
  </code></pre>
  
  <p>then I copied mydll.dll into C:\Users\myname\Documents, my account's Documents folder, and MyFuncTest successfully executed.</p>
  
  <p>Changing "mydll.dll" to "C:\Windows\System32\mydll.dll" in the declaration did not work. And I tried accessing C:\Windows\System32\mydll.dll with FileSystemObject#FileExists method on the same VBA environment, but it returned False (not found).</p>
  
  <p>There was no problem on Windows XP and Word 2003.</p>
  
  <p>Can anyone help?</p>