Link to home
Start Free TrialLog in
Avatar of Kelvin Sparks
Kelvin SparksFlag for New Zealand

asked on

Object based code returning Error 429 - Active X component cannot create object

Hi Experts,

This one has be puzzled. I've current experienced this in Access 2010 and a new clean install on a new PC of Access 2013. The syntax , I have used for years without issue.

Without all the other bits I start with

Dim xl As Object

A little later I have
Set xl = CreateObject("Excel.Application")

I have a command button that fires the sub with this in. If I use it, I get the error message in the title. If I put a break point on the second line shown and run the code., when it breaks at the second line, I can press F8 to step the code and it works! Let the rest of the code run - all good - lots of Excel object based code that all works.

Remove the break point and try again - and the same  - it gets to the CreateObject line - thinks about it for about 30 seconds and returns the error.

I'm out of ideas! Any one else got a bright idea. I do not want to have to reference Excel as the will be being deployed onto many PCs of varying versions, and keeping it object based stops the problem of being backward compatible.

Kelvin
SOLUTION
Avatar of Norie
Norie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
In addition to the suggestions above, you should also insure that the machine is fully up to date in regard to Windows and Office installations.
Avatar of Kelvin Sparks

ASKER

OK, thanks. Will try an another db this evening. The current PC is a brand new one with Win 8.1 and Office Professional 2013 (fully licensed). It is a week old and is fully patched with auto updated permitted. The issue first appeared on my "old" pc, which was Win 7 Prof and Office 2010 professional - although intermittently. Having said that, the database is on the network and so that hasn't changed - which could support the theory of database corruption. Anyway, good thoughts for me to try and report back.


Kelvin
Back again. Since last post I have:
1.  Created an empty Access accdb in Access 2013.
                Connected my tables to BE database.
                Copied the VBA into new modules.
                Created anew form and copied the existing VBA behind it
2.  Unregistered and reregistered Excel
2.  Ran the functionality
              It still works when a breakpoint I inserted for the offending line and F8 is pressed to step that line and F5 to            run the remaining code (extensive Excel based activity)
             It still fails with same error if the code is run without a breakpoint - same as on an earlier PC with Office Professional 2010 and Win Professional 7 (new PC is Win 8.1 Prof and Office Prof 2013.

The PC is fully patched and is set to automatically update Windows and other MS applications.

I'm out of ideas - I've been developing in Access since the mid 90's and am now stumped.

Kelvin
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Dale,

Thanks - we think along similar lines - was how I developed it

Scott,

again thanks - will be worth a shot. Not sure that is the cause - 1st happened on one PC, then followed to a completely new pc with different OS and version of Office.

Kelvin
Solved it!

I added a 1 second pause immediately prior to the line
Set xl = CreateObject("Excel.Application")

No more issues - all that happened before this was a warning to users that existing Excel instances were being closed and a check for any (and closing them if there were) - it didn't matter previously whether there were any open or not - still got the error.

I appreciated the support and points issued appropriately.


Thanks


Kelvin