Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run time Error Automation Error

Status
Not open for further replies.

hyugo

Technical User
Jul 20, 2004
7
US
I am creating a macro in excel and this is the code I have.

Range("P4:p14").Select
Selection.ClearContents
Range("E4:O14").Select
Range("O14").Activate
Selection.Cut Destination:=Range("F4:p14")
Range("F4:p14").Select
Range("E4:E14").Value = Range("D4:D14").Value


When the macro runs I have the fallowing error.

Run-time error '-2147417848 (80010108)'
Automation error
The object invoked has disconnected from its clients.

I have tried running the same macro on 3 other machines besides my own and the other 3 work. Does anyone have any idea why I am getting this error?
 
Not sure about the error, but your code could be simplified quite a bit. Selecting is very rarely necessary, and can sometimes cause strange errors. Try:
Code:
    Range("P4:P14").ClearContents
    Range("O14:E4").Cut Destination:=Range("F4")
    Range("E4:E14").Value = Range("D4:D14").Value
Which should do the same thing as your code.

Let us know if that clears up the error or not!

VBAjedi [swords]
 
Thanks, this did simplify the program a little. The error turned out to just be an error with my excel.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top