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 8230679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:12:56+00:00 2026-06-07T17:12:56+00:00

Good afternoon, all. I was playing around today with Excel & VBA loading some

  • 0

Good afternoon, all.

I was playing around today with Excel & VBA loading some DLLs and seeing what kind of trouble I could get into.

I made my own, very simple DLL to try it out. I can’t for the life of me figure out why, but I keep getting the “Specified DLL function not found” message when I try to run.

Here’s what I have in my workbook…

    Private Declare Sub MouseClick Lib "\location\of\myDLL" Alias "_MouseClick" ()
    'I have also tried...
    'Private Declare Sub MouseClick Lib "\location\of\myDLL" ()

    Sub Test()
            MouseClick
    End Sub

Here’s my simple function declaration in the DLL…

    extern "C" 
    {
            void MouseClick();
            ...
    }

I thought that maybe the name of my function was being mangled when compiled, so I used ‘nm’ to check…

    $ nm myDLL.dll | grep MouseClick
    6df81254 T _MouseClick

    $ nm -C myDLL.dll | grep MouseClick
    6df81254 T MouseClick

I don’t understand… I’ve used both of those to try to get it to work.
Also, I disassembled a function that calls the MouseClick function using gdb…

    $ gdb myDll.dll
    (gdb) disass testFunction
    Dump of assembler code for function testFunction:
       0x6df81327 <+0>:     push   %ebp
       0x6df81328 <+1>:     mov    %esp,%ebp
                       ...
       0x6df81361 <+58>:    call   0x6df81a44 <SetCursorPos@8>
       0x6df81366 <+63>:    sub    $0x8,%esp
    -> 0x6df81369 <+66>:    call   0x6df81254 <MouseClick>
       0x6df8136e <+71>:    jmp    0x6df8138a <testFunction+99>
                       ...
       0x6df8138a <+99>:    leave
       0x6df8138b <+100>:   ret
    End of assembler dump.

Here, too the function is referred to as “MouseClick”.

I may be going about this all the wrong way, but I don’t understand why gdb and nm are both showing a “clean” function name, but Excel won’t work with either of the ones I assumed it would be. I did get the dll to work with my VBA sub for a time, but I changed the document and now it’s not working.

Would someone that has done this before be kind enough to point me in the right direction about all this? What should I name the function in Excel? Why is nm showing a function name that isn’t mangled? Am I even going about this the right way?

Thanks to all in advance!

  • 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-06-07T17:12:58+00:00Added an answer on June 7, 2026 at 5:12 pm

    Somebody went through all this already and updated his question to include the solution:

    Compile a DLL in C/C++, then call it from another program

    The answer is specific for gcc, which is what you seem to use.

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

Sidebar

Related Questions

Good afternoon all, I'm using a java.lang.StringBuilder to store some characters. I have no
afternoon all. Iv'e come across some mathematical problems that im not too good at.
Good afternoon, with all the buzz around the iPhone / AppStore etc, I felt
Good Afternoon all , I have downloaded data from a web service and im
Good Afternoon All, I have two tables in my SQL Server 2005 DB, Main
Good afternoon all, I have a Java applet that I wish to embed on
Right, Good afternoon all (well, it is afternoon here in the UK!) I am
Good afternoon, all. I'm not too hopeful for a yes here, but if anyone
Good afternoon, I've run into some issues trying to combine HTTP caching with Rack::Cache
Good afternoon all, I am building a function that takes a string as input,

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.