Tough Excel/Access/VBA Problem! Please Help!!!

L

levileonards

Here is my problem:

At my office we multiple computers running different versions o
Windows (98, 2000, XP). I have an Excel 97 spreadsheet that uses VBA t
create a form populated with data from an Access 97 Database and fil
out Excel Templates from the same database. The Excel file is locate
on the network where everyone can run it. After someones computer died
I reinstalled Windows 2000. Now this same Excel file gives me an erro
when trying to run one of the macros. Upon investigation I found tha
this file works on some computers and not others. It worked o
computers running Windows 98, 2000 and xp and yet did not work on othe
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.Value
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 update
everything and reinstalled office. I started looking at some of th
settings in Excel and the Visual Basic Editor. I had read something o
another forum about the 'Refereces' in the Visual Basic Editor. On
that came to my attention was 'Microsft DAO 3.51 Object Library', bu
it was already selected. I turned this setting off, and saved the fil
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 o
and saved the file.
When I tried it again, it worked...on everybody's computer! I wa
please because I thought I had solved the problem, but after a fe
days, everyone was complaining that though it did work on everyone
computer now, it was horribly slow when importing and exporting data t
the Access Database, before it was a few seconds, now it was severa
minutes. I had saved the old file, so we tried both files on differen
computers. On computers that the file worked before, the old file stil
worked and was fast, and the new file worked, but was slow. On computer
that the file did not work before, the old file did not work, and th
new file worked, but was slow. I am very confused as to why it works o
some, but not others.

What confuses me even more is that all I did to 'fix' the problem wa
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 export
the data without opening Access in a window. The new file opens a
access window and requires the user to log using the name and passwor
specified in 'SYSTEM.MDW'???

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

Simon Murphy

Have a look at the reference checker in the free products section of
www.codematic.net.
run this on the different machines to see if the version of DAO is
slightly different (different build number - should give a different
guid) if so the tool will point it out.
Also try looking at the properties of the actual dll that DAO 3.51 is
pointing at on the different machines.
Are they all patched to the same level?
Same (exact) version of Internet Explorer?
rest assured this sort of thing is a common problem when client PCs are
not totally identical.
Post back if none of this helped

cheers
Simon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top