Compile error: Automation error, Error 32811: Unexpected error 
Author Message
 Compile error: Automation error, Error 32811: Unexpected error

I am posting this again as the problem has not been resolved!

I developed a database from scratch several months ago which uses lots of
VBA code. Every now and then my users 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!  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.  I have tried Repairing and Compacting but it doesn't help.  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!
=======================================================================
Update to my last messageboard post:

Last time I copied all the forms, modules, etc to another blank database I
started getting another error:

Error 32811: Unexpected error

Microsoft says this happens when importing a form from a prior version.
However I am not importing a form.  This happens when entering data in a
form and a subform is referenced.  The highlighted code is

Dim sb as Subform

I started a new blank form for the subform, copied the fields and the VBA
code and the error 32811 went away on my machine but not others.  I
recreated the other subform and now I am back to "Automation Error", which
doesn't allow code changes or anything; it locks up the database.

There are also nowhere near 700 controls, etc on this form, only 29
including the subform fields and controls, which is one Microsoft
explanation for the error.

Somebody please give me some help here!
Thanks,
Michele



Sun, 16 Feb 2003 03:00:00 GMT  
 Compile error: Automation error, Error 32811: Unexpected error
Check your References.  You may not have (if I can remember properly) the
Microsoft DAO 3.6 Object Library, or the Microsoft Common Dialogue Control
6.0 (sp3) listed.  I believe to have been having the same problem until I
enabled these.  If you don't have 'em they're posted on MS'es web site for
d/l in the same place the ADO and DAO controls are, I think.  Been too long
since I did it, but I believe that is correct.

-- jb


Quote:
> I am posting this again as the problem has not been resolved!

> I developed a database from scratch several months ago which uses lots of
> vba code. Every now and then my users 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!  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.  I have tried Repairing and Compacting but it doesn't help.  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!
> =======================================================================
> Update to my last messageboard post:

> Last time I copied all the forms, modules, etc to another blank database I
> started getting another error:

> Error 32811: Unexpected error

> Microsoft says this happens when importing a form from a prior version.
> However I am not importing a form.  This happens when entering data in a
> form and a subform is referenced.  The highlighted code is

> Dim sb as Subform

> I started a new blank form for the subform, copied the fields and the VBA
> code and the error 32811 went away on my machine but not others.  I
> recreated the other subform and now I am back to "Automation Error", which
> doesn't allow code changes or anything; it locks up the database.

> There are also nowhere near 700 controls, etc on this form, only 29
> including the subform fields and controls, which is one Microsoft
> explanation for the error.

> Somebody please give me some help here!
> Thanks,
> Michele



Sun, 16 Feb 2003 03:00:00 GMT  
 Compile error: Automation error, Error 32811: Unexpected error

At first I had only:

Visual Basic for Applications
Microsoft DAO 3.51 Object Library
Microsoft Access 8.0 Object Library.

However I just looked at Northwind and other databases I have developed or
used and added all the references these showed as well.  I now have:

VBA
C:\PROGRAM FILES\COMMON FILES\MICROSOFT SHARED\VBA\VBA332.DLL
Access
C:\Program Files\Microsoft Office\Office\msacc8.olb
DAO
C:\PROGRAM FILES\COMMON FILES\MICROSOFT SHARED\DAO\DAO350.DLL
Excel
C:\Program Files\Microsoft Office\Office\excel8.olb
utility
C:\Program Files\Microsoft Office\Office\utility.mda

I will now hold my breath and see if I get the errors again.  The Microsoft
DAO 3.6 Object Library and the Microsoft Common Dialogue Control 6.0 (sp3) I
wasn't able to find yet; if I keep having errors I will look for these next.

Thanks...


Quote:
> Check your References.  You may not have (if I can remember properly) the
> Microsoft DAO 3.6 Object Library, or the Microsoft Common Dialogue Control
> 6.0 (sp3) listed.  I believe to have been having the same problem until I
> enabled these.  If you don't have 'em they're posted on MS'es web site for
> d/l in the same place the ADO and DAO controls are, I think.  Been too
long
> since I did it, but I believe that is correct.

> -- jb



Mon, 17 Feb 2003 22:29:06 GMT  
 Compile error: Automation error, Error 32811: Unexpected error
1. Compile and Save ALL. If it grays out then the app is compiled.
    If it doesn't try this:

2. Compact the mdb.

3. Compile and Save ALL.

4. Compact again. Check to see if mdb is compiled.

5. Once it is compiled, make a back up copy or three.

6. On a copy, open it using the undocumented /decompile switch.
See www.trigeminal.com for more info on why this is dangerous.

7. Compact the mdb and recompile it.

8. It should be significantly smaller than you backups.
(Old code was "trapped" in there and it wouldn't go away without the help of
the /decompile switch.)

9. If you feel really confident, import all your "clean" objects into a new
mdb container.

10. Run the new one and see if everything is OK. Make backups!

11. Finally, don't set references to libraries that you don't use. Are you
really automating Excel?

--
Joe
Access MVP
Check out Dev Ashish's web site for answers to common questions
http://www.mvps.org/access/


Quote:

> At first I had only:

> Visual Basic for Applications
> Microsoft DAO 3.51 Object Library
> Microsoft Access 8.0 Object Library.

> However I just looked at Northwind and other databases I have developed or
> used and added all the references these showed as well.  I now have:

> VBA
> C:\PROGRAM FILES\COMMON FILES\MICROSOFT SHARED\VBA\VBA332.DLL
> Access
> C:\Program Files\Microsoft Office\Office\msacc8.olb
> DAO
> C:\PROGRAM FILES\COMMON FILES\MICROSOFT SHARED\DAO\DAO350.DLL
> Excel
> C:\Program Files\Microsoft Office\Office\excel8.olb
> utility
> C:\Program Files\Microsoft Office\Office\utility.mda

> I will now hold my breath and see if I get the errors again.  The
Microsoft
> DAO 3.6 Object Library and the Microsoft Common Dialogue Control 6.0 (sp3)
I
> wasn't able to find yet; if I keep having errors I will look for these
next.

> Thanks...



> > Check your References.  You may not have (if I can remember properly)
the
> > Microsoft DAO 3.6 Object Library, or the Microsoft Common Dialogue
Control
> > 6.0 (sp3) listed.  I believe to have been having the same problem until
I
> > enabled these.  If you don't have 'em they're posted on MS'es web site
for
> > d/l in the same place the ADO and DAO controls are, I think.  Been too
> long
> > since I did it, but I believe that is correct.

> > -- jb



Tue, 18 Feb 2003 13:06:54 GMT  
 Compile error: Automation error, Error 32811: Unexpected error
Joe,
I made a backup and decompiled it.  The first time there were several
errors, the second time it worked fine. I then recompiled and saved all of
the modules. I have tested all the forms, reports and modules and it seems
to be working.  I will of course keep the old version around just in case,
and a copy of the new one!!  I ended up with a slightly larger database
though.  I have imported all the "clean" objects into a new mdb container
many times previously trying to fix whatever was causing the errors in the
first place.  It worked for a while.
No, I'm not automating excel, I was just desperate to make this dB work!

Thanks for your help
Michele


Quote:
> 1. Compile and Save ALL. If it grays out then the app is compiled.
>     If it doesn't try this:

> 2. Compact the mdb.

> 3. Compile and Save ALL.

> 4. Compact again. Check to see if mdb is compiled.

> 5. Once it is compiled, make a back up copy or three.

> 6. On a copy, open it using the undocumented /decompile switch.
> See www.trigeminal.com for more info on why this is dangerous.

> 7. Compact the mdb and recompile it.

> 8. It should be significantly smaller than you backups.
> (Old code was "trapped" in there and it wouldn't go away without the help
of
> the /decompile switch.)

> 9. If you feel really confident, import all your "clean" objects into a
new
> mdb container.

> 10. Run the new one and see if everything is OK. Make backups!

> 11. Finally, don't set references to libraries that you don't use. Are you
> really automating Excel?

> --
> Joe
> Access MVP
> Check out Dev Ashish's web site for answers to common questions
> http://www.mvps.org/access/



Tue, 18 Feb 2003 23:10:16 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Unexpected error (32811)

2. Unexpected error (32811)

3. Unexpected Error (32811)

4. Unexpected error 32811

5. unexpected error 32811

6. HELP: Unexpected Error (32811) when adding COMCTL32.OCX

7. (solution) Unexpected error (32811) adding comctl32.ocx controls to toolbox

8. Unexpected error (32811) adding comctl32.ocx controls to toolbox

9. Visual Basic 5 - Unexpected error (32811) - Help Needed !

10. Solution to Unexpected Error 32811

11. Visual Basic 5 - Unexpected error (32811) - Help Needed !

12. Unexpected Error 32811 - What the hell is it?

 

 
Powered by phpBB® Forum Software