Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Unknown where is the problem on the Runtime error - Automation error

I ran the following code and kept on getting the following
error message after successfully pasting the data
into 'ThisWorkbook.Sheets("BU").Range("A6")'
" Runtime error '-2147417848 (80010108)
Automation error.
The object invoked has disconnected from its clients."

Hence, I'm not able to perform the 2nd copy. I looked
into the MS Support site and it(813120) talked about this
same error but it relates to inserting a pagebreak.
Below is the code. Can someone please tell me where is
the problem ?

Set wkbk = Workbooks.Open(fPathname)
wkbk.Sheets(1).Range("A10:C19").Copy
wkbk.Sheets(1).Paste Destination:=ThisWorkbook.Sheets
("BU").Range("A6")

wkbk.Sheets(1).Range("F10:C19").Copy
wkbk.Sheets(1).Paste Destination:=ThisWorkbook.Sheets
("BU").Range("E6")

Application.DisplayAlerts = False
wkbk.Close fPathname
Application.DisplayAlerts = True

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Unknown where is the problem on the Runtime error - Automation error

Set wkbk = Workbooks.Open(fPathname)
wkbk.Sheets(1).Range("A10:C19").Copy
ThisWorkbook.Sheets("BU").Range("A6").PasteSpecial _
xlallvalues
wkbk.Sheets(1).Range("F10:C19").Copy
ThisWorkbook.Sheets("BU").Range("E6").PasteSpecial _
xlAllValues
wkbk.Close False


Your paste looked odd...the code above should sort you
out.

Patrick Molloy
Microsoft Excel MVP



-----Original Message-----
I ran the following code and kept on getting the

following
error message after successfully pasting the data
into 'ThisWorkbook.Sheets("BU").Range("A6")'
" Runtime error '-2147417848 (80010108)
Automation error.
The object invoked has disconnected from its

clients."

Hence, I'm not able to perform the 2nd copy. I looked
into the MS Support site and it(813120) talked about

this
same error but it relates to inserting a pagebreak.
Below is the code. Can someone please tell me where is
the problem ?

Set wkbk = Workbooks.Open(fPathname)
wkbk.Sheets(1).Range("A10:C19").Copy
wkbk.Sheets(1).Paste Destination:=ThisWorkbook.Sheets
("BU").Range("A6")

wkbk.Sheets(1).Range("F10:C19").Copy
wkbk.Sheets(1).Paste Destination:=ThisWorkbook.Sheets
("BU").Range("E6")

Application.DisplayAlerts = False
wkbk.Close fPathname
Application.DisplayAlerts = True

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
JB Bates' Runtime Error 1004 problem Ken Johnson Excel Discussion (Misc queries) 0 December 26th 09 10:32 PM
Runtime 440:Automation Error Amit Patel[_2_] Excel Discussion (Misc queries) 0 October 3rd 09 06:24 AM
xpath error? Runtime Error 13 type mismatch Steve M[_2_] Excel Discussion (Misc queries) 0 January 17th 08 01:16 AM
Problem with excel macro - getting automation error [email protected] Charts and Charting in Excel 3 October 24th 07 05:22 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM


All times are GMT +1. The time now is 01:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"