On Error Resume Next TROUBLE

W

Walt Weber

Hi to All,

I have an application that runs well on my Win98 / Excel
2002 setup, but fails on my WinXP / Excel 2002 setup using
the same file. The failure point is after an On Error
Resume Next line as follows:

On Error Resume Next
With pvtTable1.PivotFields("Absence")
.PivotItems("0").Visible = False <-- FAILS HERE
.PivotItems("").Visible = False
.PivotItems("(blank)").Visible = False
End With
On Error GoTo 0

The Error Message is:
Runtime Error 1004
Unable to get the PivotItems property of the PivotField
class.

It seems as though the On Error Resume Next is not
functioning on my WinXP / Excel 2002 setup. Yet I've
gone through Excel's Detect and Repair and I've confirmed
that I have the latest Office XP update from Microsoft's
web site on this machine.

Has anyone else observed this?

Best Regards,
Walt
 
R

Rob Bovey

Hi Walt,

From the VBE menu, choose Tools/Options/General and make sure the Error
Trapping option is not set to Break on All Errors.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 
W

Walt Weber

Hi Rob,

Thank you. That was it! I must have done it, but it
must have been during a senior moment - I sure can't
remember doing so.

Best Regards,
Walt
 

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