On Error Resume Next

J

Jim Sharrock

On Error Resume Next
Set p = ActiveSheet.Pictures.Insert(strPicRef)

When I access a picture that I cannot open, the above gives me run time
error 1004 via the debug dialogue box and no means of trapping the error.

Any idea why ?

Thanks, Jim.
 
B

Bob Phillips

Jim,

What do you mean by 'cannot open'.

I tried it with a file that didn't exits, and it went ok. B TW I declared p
as a Picture object.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
J

Jim

I have a .eps file that I cannot open within a macro. I have lots that I can
and I am trying to give the user a more meaningful message other than "Run
time error '1004', unable to get the insert property of the picture class".

I thought that if I placed 'On Error Resume Next' before the command that is
giving rise to the error I could display my own 'stuff' but no, it still
displays the standard run time error...

I have just had a thought, I set 'Break on all errors' so that I could trap
the error in debug, I've set that off and all's ok.

Cheers Bob.

Hope the weather's fine in Poole today !
 

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