Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Very Final Powerpoint Macro Question

Posted on 2011-02-25
2
Medium Priority
?
357 Views
Last Modified: 2012-05-11
I have noticed that de-bugging code in PPT 2010 is is real pain - if an error occurs then the code just seems to stop. There is no error message indicating where the error is - is their a setting somewhere to make debugging easier?

If a piece of code is trying to update a non-existant shape for example I would like it to stop and tell me so and highlight the cause (line) of the error and not just stop and leave me wondering why - I've wriiten code in previous versions of XL and Word and this is the default behaviour - I'm not sure if this 'silent error behaviour' is a PPT thing or and Office 2010 thing.
0
Comment
Question by:KCTS
2 Comments
 
LVL 23

Expert Comment

by:JSRWilson
ID: 34979851
That seems to be the default here.
Maybe have a look what you have set in vbe>>Tools >> Options >>General but I didn't think you could disable completely
0
 
LVL 7

Accepted Solution

by:
hippohood earned 2000 total points
ID: 35010318
This behaviour is certainly not a PPT general thing. I just checked on my PPT 2007 and the behaviour is as expected (code aborted, debugging proposed by VBA). Below is the example of error I generated for the test
Presentations(1).Slides(1).Shapes("nosuchshape").Delete

Open in new window


I don't think that this is Office 2010 thing either, becasue earlier I was doing macros in Excel 2010 and I would notice such problem.

There code reasons which would casue such behavior:
1) having error handlers somewhere in your code, things like
On Error Resume Next

Open in new window

You may try dropping all the error handlers to see if it would help
On Error Goto 0 

Open in new window

2) check your Error Trapping settings. In 2007 it is in VBA menu Tools\Options\General and check proper items or do it in the code
Application.SetOption "Error Trapping", 2

Open in new window

3) using an Add-Ins or com modules, which may interrupt your code in unexpected ways

You may create your own error handler, which, at least, would inform you at which module and which line the error happened by using Erl function
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question