OLEObject error after Office Update

Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: OLEObject error after Office Update

  1. #1
    Board Regular
    Join Date
    Apr 2010
    Location
    Prague, CZ
    Posts
    320
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default OLEObject error after Office Update

     
    Hi,

    for several years I use this code to hide/show buttons on Ws and change their caption
    Code:
        Dim cBtn As MSForms.CommandButton
        Dim oleObj As OLEObject
        For Each oleObj In loDny.OLEObjects
            If TypeOf oleObj.Object Is MSForms.CommandButton Then
                             
                Set cBtn = oleObj.Object
                If cBtn.Name = "cb_dny_overV" Then GoTo nextC
                If cBtn.Name Like "cb_dny*" Then
                    i = CInt(Right(cBtn.Name, 2))
                    
                  If i > someNumber Then
                        cBtn.visible = False
                    Else
                        cBtn.visible = True
                        s = "some button caption"
                        cBtn.Caption = s
                    End If
                End If
            End If
    nextC:
        Next
    so this has worked so far. Since yesterday (and I suspect but Im not sure it has something to do with recent office updates) this line does not work

    Code:
     If TypeOf oleObj.Object Is MSForms.CommandButton Then
    says: Unable to get the Object property of the OLEObjet class.

    I tested on 2 w8.1 computers wth Office 2013 x64 and 1 w8.1 compuer with Office 2013 x86 but no luck
    Im 100% sure I have made no changes, I have reular backups of my project and older versions don't work either...
    If there's something in my code you could do better, please let me know!

  2. #2
    MrExcel MVP
    Moderator
    Andrew Poulsom's Avatar
    Join Date
    Jul 2002
    Posts
    73,092
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: OLEObject error after Office Update

      
    From Office Update breaks ActiveX controls | Excel Matters:

    It seems that a recent Office update has broken ActiveX controls on worksheets.

    To fix it, do this:

    1. Close all Office applications.
    2. Do a search in Windows Explorer for *.exd files (note: that’s not *.exe !!) and delete any you find. Make sure you get this one: C:\users\username\AppData\Local\Temp\Excel8.0\MSForms.exd
    3. Restart your Office apps and test the controls again.

    Hopefully that will resolve the problem for you.
    Microsoft MVP - Excel

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com