Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 17th, 2003, 08:20 AM
Registered User
 
Join Date: Nov 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Refernces in VBA

I have a VBA script running which goes away to a SQL database to get information. On the machine that i have developed the script it works fine as i have gone TOOLS|REFERENCES and picked on Microsoft Active X Data Objects 2.7 Library. However when i run it on another machine this library shows as missing. Can i get my VB script to check if the DLL is referenced and if not load it?

PS I am quite new to this game so i apologise if this is a simple one but it is causing me all sorts of problems

Thanks
Ian PIke

 
Old November 17th, 2003, 08:28 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ian, you'll need to install MDAC 2.7 (microsoft data access components), which can be downloaded from microsoft. Unfortunately, I don't think you can get your script to do it, because it will complain about missing components before actually running any code. It might be an idea to recompile your original script using ADO 2.1 (unless you are using some 2.7 specific method), as this should run on versions of Excel from 97 onwards. Or you could just repoint your script on the destination machine to whatever version of ADO it has.

HTH

Chris



There are two secrets to success in this world:
1. Never tell everything you know





Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA help davidbrooks Visual Basic 2008 Essentials 2 March 26th, 2008 07:25 PM
Code works in Excel VBA but not Access VBA fossx Access VBA 2 May 21st, 2007 08:00 AM
New to VBA. Please help me. rupen Access VBA 1 May 27th, 2005 07:54 AM
Excel VBA to SQL & back to VBA edesousa Excel VBA 1 June 1st, 2004 02:39 AM
VBA bjackman Access 1 January 7th, 2004 12:43 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.