ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Follow on from Hiding 5 command buttons - Excel 97 prob now (https://www.excelbanter.com/excel-programming/351795-follow-hiding-5-command-buttons-excel-97-prob-now.html)

Karoo News[_2_]

Follow on from Hiding 5 command buttons - Excel 97 prob now
 
Hi I got this from Tom which works great on my Office XP but does not work
on 97. I'm not really familiar with that! Is it that 97 does not recognise
these instructions? Help most respected!

Sub ABC()
Dim Obj As OLEObject
For Each Obj In Worksheets( _
"New Style 2006").OLEObjects
If TypeOf Obj.Object Is MSForms.CommandButton Then
Obj.Visible = Not Obj.Visible
End If
Next
End Sub




Tom Ogilvy

Follow on from Hiding 5 command buttons - Excel 97 prob now
 
It was actually written and tested in Excel 97 when I posted it.

--
Regards,
Tom Ogilvy


"Karoo News" wrote in message
...
Hi I got this from Tom which works great on my Office XP but does not work
on 97. I'm not really familiar with that! Is it that 97 does not recognise
these instructions? Help most respected!

Sub ABC()
Dim Obj As OLEObject
For Each Obj In Worksheets( _
"New Style 2006").OLEObjects
If TypeOf Obj.Object Is MSForms.CommandButton Then
Obj.Visible = Not Obj.Visible
End If
Next
End Sub







All times are GMT +1. The time now is 01:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com