"the object invoked has disconnected from its clients" excel 2010

marish86

New Member
Joined
May 4, 2011
Messages
8
Hi, I'm getting the following error message when running a VBA macro in excel 2010,

"Run-time error '-2147417848 (80010102)':
Automation error
The object invoked has disconnected form its clients. "

The issue is that on excel 2007 the macro works perfectly, however I've tried to run the same macro in two different computers that have excel 2010 and I can't get the macro to work. On one of the computers I get a different error related to "not enough resources" (even though nothing is running on the background)

On both computers the macro stops in the same point:

Code:
 Cells.Select
    Selection.Sort Key1:=Range("A" & iRow), Order1:=xlAscending, header:=xlYes, _
    OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom


The macro is very complex and this is just part of it. I've seen that in some cases the solution is to add "Option Explicit" at the top of the module but it is already there.
 
Last edited:

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Thanks!
In a first macro data is imported from a text file, then it calls this other macro to delete unnecessary data. Please see below the whole code,

Code:
Sub deleteUnneededData()
    Dim iRow As Integer
    ThisWorkbook.Sheets("Source").Select
        
    iRow = 2
    
    Cells.Select
    Selection.Sort Key1:=Range("A" & iRow), Order1:=xlAscending, header:=xlYes, _
    OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
    
    Do Until Not IsDate(Range("A" & iRow).Value)
        If DateDiff("d", Date, Range("a" & iRow).Value) < -7 Or _
                    DateDiff("d", Date, Range("a" & iRow).Value) > CInt(frmInitialize.lstDaysAhead.Value) Then
            Range("a" & iRow).Select
            Selection.EntireRow.Delete
        Else
            iRow = iRow + 1
        End If
        
        Application.StatusBar = "Looking for unneeded rows on row " & iRow
    Loop
    
    iRow = 2
    Range("A" & iRow).Select
    Do Until Not IsDate(Range("A" & iRow).Value)
        If IsEmpty(Range("c" & iRow).Value) Then
            Range("c" & iRow).Value = "1:00"
        End If
        iRow = iRow + 1
        Application.StatusBar = "Looking for empty estimated times (set to 1:00) on row " & iRow
    Loop
    
End Sub

If necessary I can post the first macro that imports the data, just let me know.
 
Upvote 0

Forum statistics

Threads
1,223,635
Messages
6,173,479
Members
452,516
Latest member
archcalx

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