Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5951239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:30:30+00:00 2026-05-22T17:30:30+00:00

My VBA code can’t access to my DLL in the C:\Windows\System32 folder on Windows

  • 0

My VBA code can’t access to my DLL in the C:\Windows\System32 folder on Windows 7 64bit and Word 2010 32bit.

Private Declare Function my_func Lib "mydll.dll" (ByVal param As String) As Long

Public Sub MyFuncTest
  n = my_func("a")
End

I copied mydll.dll into C:\Windows\System32 and called MyFuncTest but got an error message like “Error 53: ‘mydll.dll’ not found”.

However, I changed the declaration in code to:

Private Declare Function my_func Lib "C:\Users\myname\Documents\mydll.dll" (ByVal param As String) As Long

then I copied mydll.dll into C:\Users\myname\Documents, my account’s Documents folder, and MyFuncTest successfully executed.

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).

There was no problem on Windows XP and Word 2003.

Can anyone help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:30:31+00:00Added an answer on May 22, 2026 at 5:30 pm

    This is a 32 bit DLL and a 32 bit process running in the WOW64 emulator on 64 bit Windows. File redirection is in play and so when a 32 bit process looks in system32 it is actually redirected to the 32 bit system directory SysWOW64.

    The simple and quick solution is to move the DLL to C:\Windows\SysWOW64. However, as Cody Gray points out in a comment, it is not recommended for you to place application DLLs in the system directory. Normal practice is to place the DLLs in your application folder in the program files directory and make sure that folder is in the DLL search path when the DLL needs to be loaded.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can VBA code instantiate and use .NET objects? The specific class I'm interested in
Can anyone recommend an SVN client for use in Excel with VBA (code modules
Hidden worksheets/workbooks have some limitations to what can be done in VBA code, like
Is there code in VBA I can wrap a function with that will let
Is it possible to extract all of the VBA code from a Word 2007
Is there a macro, VBA code or VBScript that I can write to edit
Simple (?) question: how can I determine the used DAO version in VBA code?
I have the following vba-code in an MS-Access97-frontend which opens a word-document stored on
Can anyone give me VBA code that will take a range (row or column)
I have working VBA code, but I can't convert it to C#. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.