Wrox Programmer Forums
|
BOOK: Excel 2000/2002 VBA Programmer's Reference
This is the forum to discuss the Wrox book Excel 2000 VBA: Programmers Reference by John Green, Stephen Bullen, Felipe Martins, Brian Johnson; ISBN: 9780764544019
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Excel 2000/2002 VBA Programmer's Reference 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 September 6th, 2005, 11:31 AM
Registered User
 
Join Date: Sep 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Tough Excel/Access Problem

Here is my problem:

At my office we multiple computers running different versions of Windows (98, 2000, XP). I have an Excel 97 spreadsheet that uses VBA to create a form populated with data from an Access 97 Database and fill out Excel Templates from the same database. The Excel file is located on the network where everyone can run it. After someones computer died, I reinstalled Windows 2000. Now this same Excel file gives me an error when trying to run one of the macros. Upon investigation I found that this file works on some computers and not others. It worked on computers running Windows 98, 2000 and xp and yet did not work on other computers running Windows 2000. It was giving the error:
    '(appECDB)Couldn't open C:\ec.mdb.'
Here is the code for appECDB:
    Function appECDB() As Database
        If ecdb Is Nothing Then
            Dim f As String
            f = ThisWorkbook.Names("EC_DB_FILE").RefersToRange.Val ue
            On Error GoTo OPEN_ERROR
            Set ecdb = DBEngine(0).OpenDatabase(f)
        End If
        Set appECDB = ecdb
        Exit Function

    OPEN_ERROR:
        appQuit "(appECDB) Couldn't open " & f & "."
    End Function
I compared everything that I could and nothing was different. I updated everything and reinstalled office. I started looking at some of the settings in Excel and the Visual Basic Editor. I had read something on another forum about the 'Refereces' in the Visual Basic Editor. One that came to my attention was 'Microsft DAO 3.51 Object Library', but it was already selected. I turned this setting off, and saved the file and tried it again. This time I got an compile error:
    User-defined type not defined.
    Where 'Private ec as Database' was higlighted as the undefined type.
I turned the reference to 'Microsoft DAO 3.51 Object Library' back on and saved the file.
When I tried it again, it worked...on everybody's computer! I was please because I thought I had solved the problem, but after a few days, everyone was complaining that though it did work on everyones computer now, it was horribly slow when importing and exporting data to the Access Database, before it was a few seconds, now it was several minutes. I had saved the old file, so we tried both files on different computers. On computers that the file worked before, the old file still worked and was fast, and the new file worked, but was slow. On computers that the file did not work before, the old file did not work, and the new file worked, but was slow. I am very confused as to why it works on some, but not others.

What confuses me even more is that all I did to 'fix' the problem was turn the reference to 'Microsoft DAO 3.51 Object Library' off, saved, and back on and saved.

Another thing that we noticed is that the old file imports and exports the data without opening Access in a window. The new file opens an access window and requires the user to log using the name and password specified in 'SYSTEM.MDW'???

Has anyone ever experienced any problem like this before or know where I can look for answers?
Any help is appreciated, thanks.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Fatal Error - A tough one! gargamel BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 3 April 4th, 2007 04:25 PM
problem querying access, exporting to Excel neversummer84 Access ASP 1 November 22nd, 2006 12:54 AM
Converting excel data to Access using excel VBA ShaileshShinde VB Databases Basics 1 April 26th, 2006 07:57 AM
tough code please help... xanderxvr Classic ASP Basics 2 January 27th, 2005 12:23 PM
Tough one !! xls as frontend with mdb as backend Stanny Access 5 January 7th, 2005 11:01 AM





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