Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Missing DLL in VBA

Posted on 2005-03-24
Medium Priority
Last Modified: 2013-12-26
I have a spreadsheet that runs vba macros. On one of the computer I was getting error because there was a check on Missing ADO Ext. But if a user is not soo fluent with excel, it would be very hard for him to tackle this problem. Is there a way I can pack this library in setup.exe and it get installed on the users computer once the installation in done.

Thank you.
Question by:Aiysha
LVL 14

Expert Comment

by:Shiju Sasidharan
ID: 13627885
Which setup software are u using to create Installable Package ?
Try using Install Shield
Its very cool and allows to embed MDAC to ur Package
u can get it from here

LVL 53

Expert Comment

ID: 13628332
Another good program to create an installer (setup-program)

LVL 29

Expert Comment

ID: 13647583
>Is there a way I can pack this library in setup.exe and it get installed on the users computer once the installation in done.

I find it very unlikely that this dll is not present on a client machine which is loaded with Excel.  Since most Excel based applications do not use a setup package, the best method is to ensure that the client conforms to your minimum requirments and/or use late binding in your code.

LVL 10

Accepted Solution

edwardiii earned 2000 total points
ID: 13653970
Hi, Aiysha.

I support an app used be several hundred employees, all supposedly with identical Win2k Pro/Office 2000 images on their desktops.  Occasionally some users get the "Missing" error.  I built the intranet page they access the application from, both the Web page and the training users receive prior to using the app instruct them to "Click here" before running the app.  They click a button with the code below in it; I find it better to forcefully ensure they've got all Excel references loaded/registered before they try to use my VBA Excel app and it crashes due to the "MISSING" scenario.  Or, you could let users try to run your Excel app, and in case it chokes you could put a button on your VBA Excel document captioned "Fix 'MISSING' Error", and drop the following code into it.  In my app, I've got about 10 line items (one for each reference--I'm not expecting the end users to know how to determine which reference is missing, so I force feed them all):

    'MS Excel 9.0 Object Library:   1
    'MS ActiveX Data Objects 2.7 Library: 2
    Dim strReferences(1 To 10) As String
    strReferences(1) = "C:\Program Files\Microsoft Office\Office\EXCEL9.OLB"
    strReferences(8) = "C:\Program Files\Common Files\System\ADO\msado15.dll"
    Dim intRefCounter As Integer
    For intRefCounter = 1 To 10
        Shell "regsvr32 """ & strReferences(intRefCounter), vbNormalFocus
    Next intRefCounter

After a user gets the "Missing" error, they should 1) close all instances of Excel 2) Do CTRL-ALT-DELETE, go to the Processes tab, and ensure no instances of EXCEL.EXE are running (if any are, right click and kill the process).  3) Re-start your application, and click the "Fix 'MISSING' Error button.  Tell them to click the "OK" button on the resulting pop-up message boxes.
LVL 10

Expert Comment

ID: 13654007
Sorry, 3 edits:

1) Change the "Dim strReferences(1 To 10) As String" to "Dim strReferences(1 to 2) As String.

2) replace array item "8" with "2" so that:

     strReferences(8) = "C:\Program Files\Common Files\System\ADO\msado15.dll"

is changed to:

     strReferences(2) = "C:\Program Files\Common Files\System\ADO\msado15.dll"

3) Change the For loop " For intRefCounter = 1 To 10" to end with "1 to 2".

Am giving you an example with only 2 references checked, my real code checks 10 references.

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

564 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