VBA Automation Error - Run Time Error -2147024770 - Specified module could not be found

Posted on 2009-12-23
Last Modified: 2012-05-08
I found the same error in my search here, but the link to the download for a fix on MSDN was broke.

The error appears when I call a function in my module:

Set xmlRequestdoc = newJBXMLRequest(sessionID)

This program has been running fine for year and I have not changed any code in the program.  I checked my VBA references on this machine vs a working machine and the same list appears.

I beleive the machine I'm having the error on has had the 2007 add-in to allow to open 2007 files for quite a while now and I have not had this problem, the only thing I can think of is a recent 2007 file I was working with my Office 2003 install of Excel may have messed things up somehow.

Please let me know your thougts on how to fix this.
Question by:JMO9966

    Author Comment

    I've isolated further where the error occurs:

    Function newJBXMLRequest(sessionID As String) As DOMDocument40

    Dim result As New DOMDocument40
    Set Session = result.createAttribute("Session")       'This is where the error happens

    I have a reference in my VBA project to Microsoft XML, v4.0 that has always worked fine.  I'm not getting the error on both of my machines, obviously an update I did has changed something that VBA is referencing but I'm lost at how to fix this.

    Author Comment

    I re-wrote the application in and I get the same error.  It must be an issue with the COM object I'm referencing.
    LVL 32

    Accepted Solution

    is one machine 64bit, the other 32 bit ?  

     I have this issue with Autocad VBA routines; the DLL reference is there but doesnt work until I open the code on the correct target machine and resave. All ok after that.

    Author Comment

    both machines are 32 bit.  thanks

    Something strange with my machine I agree, just not sure how to fix it.

    LVL 32

    Assisted Solution

    by:Robberbaron (robr)
    if you edit and resave the app on the machine that is currently NOT working, does it then work ok on the other. This may help isolate the version of DLL causing issue.

    Author Closing Comment

    I had to uninstall and re-install an older version version of the program that owns this com file.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now