OLEObject error after Office Update

storm8

Active Member
Joined
Apr 7, 2010
Messages
327
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...
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
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.
icon_smile.gif
 
Upvote 0

Forum statistics

Threads
1,212,927
Messages
6,110,696
Members
448,293
Latest member
jin kazuya

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