none
How could I observe which dll or assemblies are called when I run a small piece of VBA code in Excel? RRS feed

  • Question

  • Hello,

    I have an old problem that I could not solve yet. (see here or here)
    I have created a tiny COM-Visible assembly in VS2013 and I call it in VBA to demonstrate the problem:

    Function test(str)
        Set obj = New netcom2vba.netcom2vba
        test = obj.myLen(str)
    End Function

    I would like to see in detail which pieces of code (dll, assemblies, ...) are called before (if) the VBA call reaches the C# method I try to call.

    I could debug the code in VS2013 on a "developer machine" where it always works.
    I could then learn what should be called in a normal situation.
    I don't know how to do that (observing path through external code), but I hope you can guide me.

    However, I can't see at all how I could do the same on a (user) machine (in my company) where VS2013 is not installed.
    The VBA code will never reach its target C# method, but I would nevertheless like to see where it loses track.

    By observing the steps before the C# method is reached, I hope to understand why it doesn't work on some machines.

    Thanks for your suggestions,

    Michel

    • Edited by Lalbatros Tuesday, September 1, 2015 4:37 PM
    Tuesday, September 1, 2015 4:35 PM

Answers

  • Personally I would install the Windows Debugging Tools and attach a crash dump to the process and capture everything that is happening until you "don't" see whatever it is you expect to see. You could also merely attach procmon and filemon as well. But you cannot expect to see actual "code" that isn't going to happen. Unless you actually own the code, the best you can do it have symbols and get some "idea" of what was happening. Especially since in this case I don't know what is hosting your VBA code (excel, word, access, etc, in which case you would never have the code for them).

    That and or do that + if it happens and you didn't have it attached, I would get a hang dump.

    But you will need then to understand how to open the files and actually read them and have it make sense.

    You can do this by attaching symbols etc after the fact, but that is difficult if you aren't exactly sure what symbols to get (even from Microsoft), so attaching to the symbol server makes the most sense.

    However... all of this is pretty moot, because unfortunately it's not exactly easy to merely say how to do this in a thread like this. Debugging and reading debug files etc (as well as getting permission to install the files in a folder) might not happen.

    Tuesday, September 1, 2015 8:15 PM