Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-07-28
9
Medium Priority
?
429 Views
Last Modified: 2014-07-31
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
0
Comment
Question by:Kelvin Sparks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 34

Assisted Solution

by:Norie
Norie earned 375 total points
ID: 40223793
Kevin

Do you have any instances of Excel running when you run the code?
0
 
LVL 35

Assisted Solution

by:ste5an
ste5an earned 375 total points
ID: 40223860
First of all: You can stick to this method ;)

It is either a corruption of your database or Excel itself. So create a new one and try your code their (don't import anything). Or try a repair installation of Excel and/or check whether you have some Excel plugins which may interfere here.
0
 
LVL 85
ID: 40223887
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.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 22

Author Comment

by:Kelvin Sparks
ID: 40225062
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
0
 
LVL 22

Author Comment

by:Kelvin Sparks
ID: 40228367
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
0
 
LVL 48

Accepted Solution

by:
Dale Fye earned 375 total points
ID: 40228730
Kelvin,

Have you tried changing over to early binding, just to test if that works?

For my Office automation, I always, initially add the reference to Excel, then set dimension my objects like

Dim xl as Excel.Application     'Object     '

which makes it easy for me go change to:

Dim xl as Object     'Excel.Application     '

when I'm done working with intellisense.
0
 
LVL 85

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 375 total points
ID: 40228763
You may need to uninstall/reinstall Office on the machine. I've had bad installs on new machines more than once ...
0
 
LVL 22

Author Comment

by:Kelvin Sparks
ID: 40229951
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
0
 
LVL 22

Author Comment

by:Kelvin Sparks
ID: 40231220
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
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question