?
Solved

Missing DLL in VBA

Posted on 2005-03-24
6
Medium Priority
?
810 Views
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.
0
Comment
Question by:Aiysha
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 14

Expert Comment

by:Shiju Sasidharan
ID: 13627885
Yes,
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
http://www.installshield.com/downloads/


;-)
Shiju
0
 
LVL 53

Expert Comment

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

http://www.jrsoftware.org/isinfo.php
0
 
LVL 29

Expert Comment

by:leonstryker
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.

Leon
0
 
LVL 10

Accepted Solution

by:
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.
0
 
LVL 10

Expert Comment

by:edwardiii
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.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…
Suggested Courses

777 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