Compile error: Automation error 
Author Message
 Compile error: Automation error

I developed a database from scratch several months ago which uses lots of
VBA code. Every now and then I suddenly get automation errors, and code
which has been working fine suddenly gets error messages which say:

Compile error:
Automation error

and the following code is highlighted

Dim dbs As Database

The help text is useless, the code worked yesterday!  It says "An error
occurred while executing a method or getting or setting a property of an
object variable. The error was reported by the application that created the
object."

After tearing my hair out trying to fix it I have found that if I start a
new blank database, import everything and make the splash form open on
startup (the way it was before) I'm OK for a while then suddenly one day it
will give me the same error.  This is Access 97 on a Win98SE machine.   I
work with several other dBs and this is the only one this happens to.

Can someone tell me what is going on here?  I have reinstalled Office 97 to
no avail.  My users are not able to handle being thrown into vba code in the
middle of data entry, and I have to recopy the database elements again!



Sat, 08 Feb 2003 03:00:00 GMT  
 Compile error: Automation error
Did you upgrade your software (eg.  Access/Excel)?  If not, check your
References (Tools->References), and make sure all of your objects you had
set previously are present.  I know you might have already done that, but
I've gone through many great lengths for a fix and the answer was under my
nose.

-- jb


Quote:
> I developed a database from scratch several months ago which uses lots of
> vba code. Every now and then I suddenly get automation errors, and code
> which has been working fine suddenly gets error messages which say:

> Compile error:
> Automation error

> and the following code is highlighted

> Dim dbs As Database

> The help text is useless, the code worked yesterday!  It says "An error
> occurred while executing a method or getting or setting a property of an
> object variable. The error was reported by the application that created
the
> object."

> After tearing my hair out trying to fix it I have found that if I start a
> new blank database, import everything and make the splash form open on
> startup (the way it was before) I'm OK for a while then suddenly one day
it
> will give me the same error.  This is Access 97 on a Win98SE machine.   I
> work with several other dBs and this is the only one this happens to.

> Can someone tell me what is going on here?  I have reinstalled Office 97
to
> no avail.  My users are not able to handle being thrown into vba code in
the
> middle of data entry, and I have to recopy the database elements again!



Sat, 08 Feb 2003 03:00:00 GMT  
 Compile error: Automation error

No recent upgrades or changes.  I don't have an option for Tools ->
References.  Is that in another version of Access besides Access 97, or in
another toolbar?  If so I haven't changed it.  This database will work for a
week or two straight then suddenly get this error out of the blue.  I'm the
only one who modifies it, users only enter data and run reports.  It has a
front and back end, the back end is OK.


Quote:
> Did you upgrade your software (eg.  Access/Excel)?  If not, check your
> References (Tools->References), and make sure all of your objects you had
> set previously are present.  I know you might have already done that, but
> I've gone through many great lengths for a fix and the answer was under my
> nose.

> -- jb



Sun, 09 Feb 2003 03:00:00 GMT  
 Compile error: Automation error

Quote:

>No recent upgrades or changes.  I don't have an option for Tools ->
>References.  

You have to be in a module to see the References.

Wierd problem that it would keep happening.  From the code referencing
"database" I would have suspected this to be Access 2000.

Tony
----
Tony Toews, Microsoft Access MVP
   Please respond only in the newsgroups so that others can
read the entire thread of messages.
   Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
   VolStar http://www.volstar.com Manage hundreds or
thousands of volunteers for special events.



Thu, 13 Feb 2003 03:00:00 GMT  
 Compile error: Automation error

This is Access 97 on Win98SE.  I would upgrade to 2000 but my users don't
all have it yet.  The problem happened twice last week.  It crashes on Dim
dbs as database, and if I comment that out it picks the next Dim statement
to be highlighted, as though they were all wrong.  I found the Tools ->
References; it's available only when code is displayed on the screen, but I
see nothing obvious missing.



Fri, 14 Feb 2003 03:00:00 GMT  
 Compile error: Automation error


Quote:
>No recent upgrades or changes.  I don't have an option for Tools ->
>References.  

Open any module in design view, then select Tools | References.

--
Mike Sherrill
Information Management Systems



Fri, 14 Feb 2003 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Compile error: Automation error, Error 32811: Unexpected error

2. Compile Error : Automation Error

3. Crystal error: error ocurred reading records: error in compiling sql expression

4. Compilation error: Automation Error (Error 440)

5. Run-time error '-2147417846 (8001010a)': Automation error (error 440)

6. Run-time error '-2147417846 (8001010a)': Automation error (error 440)

7. Automation error only when compiled

8. Automation Error with Winsock OCX on NT 4 -- compiled with VB6 (SP5)

9. Automation Error 438 when running a compiled VB program

10. Automation Error with Winsock OCX on NT 4 -- compiled with VB6 (SP5)

11. Error message: Compile error in hidden module

12. Compile Error - Permission Denied (Error 70)

 

 
Powered by phpBB® Forum Software