Hi,
for several years I use this code to hide/show buttons on Ws and change their caption
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
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...
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
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...