JB Bates' Runtime Error 1004 problem

K

Ken Johnson

I am using Google Groups to view this forum and my three attempts at
responding to this post...
http://groups.google.com.au/group/m...misc/browse_frm/thread/c671c861c59d83d9?hl=en
keep on disappearing.
I've not had this happen before.

I have seen the Pick a Pic code stopped by this error several times
before.
It usually doesn't happen until after a certain number of pictures
that it has to process.
Sufferers in the past have been happy with my solution, so here it is
again.
Don't dimension the oPic object as a Picture, dimension it as a Shape.
This does mean adding an extra loop so that only Pictures are rendered
invisible instead of all the Shapes...

Private Sub Worksheet_Calculate()
Dim oPic As Shape
For Each oPic In Me.Shapes
If oPic.Type = msoPicture Then
oPic.Visible = False
End If
Next oPic
With Range("ad1")
For Each oPic In Me.Shapes
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
Next oPic
End With
End Sub

Ken Johnson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top