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
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