pedie
Well-known Member
- Joined
- Apr 28, 2010
- Messages
- 3,875
Hi, 'm recieving this error message "-2147417848 Automation error The object invoked has disconnected from its clients" - When Copying Worksheets from One Workbook to Another.
And sometime it happen that workbook fails to open up...
Error happens in the line below...
Sometime when i manually F8 one line after another it goes through...
And sometime it happen that workbook fails to open up...
Code:
[FONT=Courier New]Set MnWb= Workbooks.Open(Filename:=myMainWbstr, ReadOnly:=True, UpdateLinks:=False, CorruptLoad:=True)[/FONT]
Error happens in the line below...
Sometime when i manually F8 one line after another it goes through...
Code:
[FONT=Courier New]Set [FONT=Courier New]XWb[/FONT]= Workbooks.Open(Filename:=[FONT=Courier New]XWbFile[/FONT], ReadOnly:=True)
For Each sh In [FONT=Courier New]XWb[/FONT].Worksheets
If sh.Name <> "Notes" And sh.Visible = xlSheetVisible Then
[U]Workbooks(XWb.Name).Sheets(sh.Name).Copy After:=Workbooks(MnWb.Name).Sheets(Workbooks([FONT=Courier New]MnWb[/FONT].Name).Sheets.Count)
[/U] Sheet4.Cells(i, 36).Value = Sheet4.Cells(i, 36).Value + 1
End If
Next sh[/FONT]
Last edited by a moderator: