VBA run-time error 9 & Runtime Error 429 - ActiveX Component Can't Create Object

Apple1

Board Regular
Joined
Jan 18, 2015
Messages
121
Using Excel 2010.

I have this simple piece of code


With ThisWorkbook.Sheets("AA")
.Cells.Copy 'Replace the sheet with values
.Range("A1").PasteSpecial Paste:=xlPasteValues
End With

It works when I use it in other workbook.

But for this particular workbook when it is part of a larger code I get this error:
"Runtime error 9 "subscript out of range"

When I use it as a standalone, I get the error:
"Runtime Error 429 - ActiveX Component Can't Create Object"

I also get the error: "Runtime Error 429 - ActiveX Component Can't Create Object"
when I run other code.

Could there be something wrong with the particular workbook? The workbook was spoil before when I ran a macro.

Thank you
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
The only bit in your simple code which could cause a Subscript error is Sheets("AA") there has to be a Sheet called AA in any work book to get this code to work,

all the other messages suggest other stuff, not posted here, is going on
 
Last edited:
Upvote 0
Upvote 0
Hi

Thank you for the reply.
There is no error with the name of the worksheet as I tried the code using the order of the sheet instead, I get the error:

"ActiveX Component Can't Create Object"

With ThisWorkbook.Sheets(2)
.Cells.Copy 'Replace the sheet with values
.Range("A1").PasteSpecial Paste:=xlPasteValues
End With

The link below is pointing to this thread. Can you provide the correct link?

Thank you


The "Subscript Out of Range" error suggests that the workbook doesn't contain the specified worksheet. Or, if it exists, there might be a spelling mistake or extra space somewhere.

For the "ActiveX Component Can't Create Object" error, see if this helps...

http://www.mrexcel.com/forum/excel-...429-activex-component-cant-create-object.html

Otherwise, post your code and someone will be able to help.
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top