Pictures are shape objects of type 13.
The combo box is a shape object of type 12.
For some reason, the combo box shape is being included in the Picture objects, so it is being hidden by the code.
One solution is to avoid the Picture objects in "Dim OPic as Picture", and instead use "Dim OPic as Shape".
This however does mean you can't use the "Me.Pictures.Visible = False" line and instead have to loop through all of the sheet's shapes and hide only those of type 13 (Pictures).
Also, the part of the code that shows and positions the F1 picture will also need to first test each shape's type and only act on type 13 shapes...
Private Sub Worksheet_Calculate()
Dim oPic As Shape
For Each oPic In Me.Shapes
If oPic.Type = 13 Then oPic.Visible = False
Next oPic
With Range("F1")
For Each oPic In Me.Shapes
If oPic.Type = 13 Then
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
End If
Next oPic
End With
End Sub
This code will also circumvent another known Picture object problem, namely that after something like 60 pictures on the sheet the code fails to recognise further pictures, and throws another error.
Beau Nydal
Bookmarks