Consulting

Results 1 to 9 of 9

Thread: Problem after upgrade from Excel 97 to Excel 2000

  1. #1
    VBAX Newbie
    Joined
    Feb 2005
    Posts
    4
    Location

    Problem after upgrade from Excel 97 to Excel 2000

    This code would work in Excel 97 (from the help file):

    Dim EntryCount As Single
    
    Private Sub CommandButton1_Click()
     EntryCount = EntryCount + 1
        ListBox1.AddItem (EntryCount & " - Selection")
    End Sub
    Private Sub CommandButton2_Click()
        'Ensure ListBox contains list items
        If ListBox1.ListCount >= 1 Then
            'If no selection, choose last list item.
            If ListBox1.ListIndex = -1 Then
                ListBox1.ListIndex = _
                        ListBox1.ListCount - 1
            End If
            ListBox1.RemoveItem (ListBox1.ListIndex)
        End If
    End Sub
    Private Sub UserForm_Initialize()
        EntryCount = 0
        CommandButton1.Caption = "Add Item"
        CommandButton2.Caption = "Remove Item"
    End Sub

    but, now that I have upgraded to Execl 2000 I get this error at "ListBox1.AddItem":

    Error 80010108 Automation error. The object invoked has disconnected from its clients

    Now I cannot use listboxes. Is there a workaround for this?

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    Does this file work for you?

  3. #3
    VBAX Newbie
    Joined
    Feb 2005
    Posts
    4
    Location
    No I get the same error. I won't be able to reply for 16 hours (hometime).

  4. #4
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    Ok, you probably have an error in the install. First uninstall Office completely. Then look in your Program Files folder and delete the MS Office folder.

    Then re-install Office and see if the problem goes away.

  5. #5
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Hey,


    Jake: Shouldn't you just be able to do a complete install and be able to overwrite all application (specific) files?

  6. #6
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    You should, but everytime that I have had an error where I needed to re-install, trying to use the Detect and Repair or just installing on top of the old install has always failed to resolve anything.

    When I delete everything and install fresh it has always worked for me.

  7. #7
    VBAX Newbie
    Joined
    Feb 2005
    Posts
    4
    Location
    I will have to ask our friendly IT people to do that!!!

    In the meantime I have got this to work (I am wanting to select one or more filenames to send to a server by FTP):

    Sub workaraound()
    Set lb = Worksheets(1).Shapes.AddFormControl(xlListBox, 100, 10, 200, 100)
    Worksheets(1).ListBoxes(1).Select
    With Selection
    .ListFillRange = ""
    .LinkedCell = ""
    .MultiSelect = xlSimple
    .Display3DShading = False
    End With
    For i = 1 To intCount
    mystamp = FileDateTime("d:\data\hockey\" & varFile(i))
    chek = DateDiff("d", Now, mystamp)
    If chek = 0 Then
    lb.ControlFormat.AddItem varFile(i)
    End If
    Next i
    Else
    MsgBox "There were no files found."
    End If
    End sub
    
    Sub peek()
    Dim kname(10) As String
    For i = 1 To Worksheets(1).ListBoxes(1).ListCount
    If Worksheets(1).ListBoxes(1).Selected(i) = True Then
    counter = counter + 1
    kname(counter) = Worksheets(1).ListBoxes(1).List(i)
    End If
    Next I
    ?????
    End sub

  8. #8
    VBAX Newbie
    Joined
    Feb 2005
    Posts
    4
    Location
    Problem solved with reinstalling Office

  9. #9
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    Glad to help.

    Take Care

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •