PC Review


Reply
Thread Tools Rate Thread

appAccess.currentdb() -- Interface not registered

 
 
Magrathea
Guest
Posts: n/a
 
      22nd Nov 2006
I have the following Excel VBA code snip that has worked well for several
months on a weekly basis.



Dim db1 As DAO.Database
Dim appAccess As Access.Application 'uses the TransferSpreadsheet method
of DoCmd.
......
Set appAccess = CreateObject("Access.application")
appAccess.OpenCurrentDatabase strFPName, False
Set db1 = appAccess.CurrentDb()

Recently it broke. The error message is:
-2147221163 Automation Error
Interface Not Registered.

The error happens at the Set db1. the currentdb() function is not
recognized.
AppAccess.OpenCurrentDatabase works because I can follow it successfully
with a Msgbox appAccess.CurrentProject.Name.

We tried reinstalling Office. No change.
It is using Access and Excel version 9.0.
Running on Windows 2000 SP4.

Tools>References>
has Excel 9.0, Access 9.0, DA0 3.60, OLE Automation. checked. Nothing
missing.

Any particular DLL's we should try to re-register?

I'm going to code around it using an Access table linked to an excel range
and run append queries. But I'd much rather fix what broke. Or at least
know what to fix the next time.

-Stephen Rasey
Houston



 
Reply With Quote
 
 
 
 
NickHK
Guest
Posts: n/a
 
      23rd Nov 2006
Magrathea,
Could be a problem with DAO, possibly re-install MDAC and/or JET drivers
depending on versions.

NickHK

"Magrathea" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> I have the following Excel VBA code snip that has worked well for several
> months on a weekly basis.
>
>
>
> Dim db1 As DAO.Database
> Dim appAccess As Access.Application 'uses the TransferSpreadsheet method
> of DoCmd.
> .....
> Set appAccess = CreateObject("Access.application")
> appAccess.OpenCurrentDatabase strFPName, False
> Set db1 = appAccess.CurrentDb()
>
> Recently it broke. The error message is:
> -2147221163 Automation Error
> Interface Not Registered.
>
> The error happens at the Set db1. the currentdb() function is not
> recognized.
> AppAccess.OpenCurrentDatabase works because I can follow it successfully
> with a Msgbox appAccess.CurrentProject.Name.
>
> We tried reinstalling Office. No change.
> It is using Access and Excel version 9.0.
> Running on Windows 2000 SP4.
>
> Tools>References>
> has Excel 9.0, Access 9.0, DA0 3.60, OLE Automation. checked. Nothing
> missing.
>
> Any particular DLL's we should try to re-register?
>
> I'm going to code around it using an Access table linked to an excel range
> and run append queries. But I'd much rather fix what broke. Or at

least
> know what to fix the next time.
>
> -Stephen Rasey
> Houston
>
>
>



 
Reply With Quote
 
Magrathea
Guest
Posts: n/a
 
      24th Nov 2006
More info on the appAccess.currentdb() error.

This works in an Access 9 Module
'References: Microsoft DAO 3.6
Dim db1 as DAO.Database
set db1 = currentdb

But
appAccess.currentdb does not work from Excel.

We haven't fixed that, but we found a workaround.

Set appAccess = CreateObject("Access.application")
appAccess.OpenCurrentDatabase strFPName, False
'Set db1 = appAccess.CurrentDb() 'old statement that broke
Set db1 = DAO.OpenDatabase(strFPName)

Now the database is open through Access and again throught DAO.
There are two connections open to the same database.
It gives all the functionality I need without the need to repair the
computer in a game of blind-man's bluff.

-Magrathea
Houston








"NickHK" <(E-Mail Removed)> wrote in message
news:u%(E-Mail Removed)...
> Magrathea,
> Could be a problem with DAO, possibly re-install MDAC and/or JET drivers
> depending on versions.
>




 
Reply With Quote
 
NickHK
Guest
Posts: n/a
 
      24th Nov 2006
Your original code ("Set db1 = appAccess.CurrentDb()") work for me. That's
why I said it sound like a registration/registry problem because of the
nature of your error.

Access 2002
DAO 3.6
W2K
Don't which know version of MDAC installed.

NickHK

"Magrathea" <(E-Mail Removed)> wrote in message
news:OCPA$(E-Mail Removed)...
> More info on the appAccess.currentdb() error.
>
> This works in an Access 9 Module
> 'References: Microsoft DAO 3.6
> Dim db1 as DAO.Database
> set db1 = currentdb
>
> But
> appAccess.currentdb does not work from Excel.
>
> We haven't fixed that, but we found a workaround.
>
> Set appAccess = CreateObject("Access.application")
> appAccess.OpenCurrentDatabase strFPName, False
> 'Set db1 = appAccess.CurrentDb() 'old statement that broke
> Set db1 = DAO.OpenDatabase(strFPName)
>
> Now the database is open through Access and again throught DAO.
> There are two connections open to the same database.
> It gives all the functionality I need without the need to repair the
> computer in a game of blind-man's bluff.
>
> -Magrathea
> Houston
>
>
>
>
>
>
>
>
> "NickHK" <(E-Mail Removed)> wrote in message
> news:u%(E-Mail Removed)...
> > Magrathea,
> > Could be a problem with DAO, possibly re-install MDAC and/or JET drivers
> > depending on versions.
> >

>
>
>



 
Reply With Quote
 
Magrathea
Guest
Posts: n/a
 
      25th Nov 2006
Yes, I know it is a registry problem.

Interestingly, however, currentdb working inside Access worked, but using
from Excel the currentdb method of the Access Application object did not.
Obviously, some registry is screwed up. Don't know how (it might have been
a windows update, might not) and I don't know how to fix it. I posted my
fix of using two connection to the database as an alternative.

-Magrathea


"NickHK" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Your original code ("Set db1 = appAccess.CurrentDb()") work for me. That's
> why I said it sound like a registration/registry problem because of the
> nature of your error.
>
> Access 2002
> DAO 3.6
> W2K
> Don't which know version of MDAC installed.
>
> NickHK
>




 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is 'interface not registered' mean? Shaz1213 Microsoft Outlook Discussion 2 9th Jul 2008 07:10 PM
Interface not registered j Microsoft Outlook Program Addins 0 5th Mar 2007 04:30 PM
Interface Not Registered? faeiz2 Microsoft Outlook 1 26th Jun 2006 02:20 AM
interface not registered =?Utf-8?B?Q2FybG9z?= Microsoft Outlook Discussion 1 15th Nov 2005 12:05 AM
Interface not registered TWS Microsoft Outlook 0 15th Nov 2003 10:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:05 PM.