Error on using Toolbar (no active document window)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can anyone help (please)?

I have created a toolbar in PowerPoint that allows users to create Brand
compliant PowerPoint presentations. The code has been saved as a ppa file but
I have noticed that if a document is not open when the user selects some of
the items on the toolbar I receive an error "Application (unknown member) :
Invalid request. There is no currently active document window." (These items
run a userform)

To trap the error, I am counting the presentations and creating a new
presentation if there are none open (which works in Word but for some reason
does not work in PowerPoint) - I receive the above error.

Any suggestions would be greatly appreciated.
Jackie
 
Can anyone help (please)?

I have created a toolbar in PowerPoint that allows users to create Brand
compliant PowerPoint presentations. The code has been saved as a ppa file but
I have noticed that if a document is not open when the user selects some of
the items on the toolbar I receive an error "Application (unknown member) :
Invalid request. There is no currently active document window." (These items
run a userform)

What exactly is the code doing when the error's thrown?
It's hard to suggest a fix w/o knowing what the problem is. ;-)
 
Hi Steve

Apologies for not being clear. The toolbar has a number of buttons, a couple
of the buttons initialises a userform. When you click any button that opens a
userform, with no document open, you receive the error.

I have tried to error trap by placing code (which identifies if a
presentation is open) on the pressing of the button but this does not appear
to work.

Regards
Jackie
 
Hi,
Apologies for not being clear. The toolbar has a number of buttons, a couple
of the buttons initialises a userform. When you click any button that opens a
userform, with no document open, you receive the error.

But you can open a userform with or w/o a document open in PPT and it won't throw an
error in and of itself. I'm guessing there's initialization code in the form or
other code in the sub the button calls (its .OnAction property) that's causing the
error.

Put a break at the beginning of the sub that runs when you click the button step
through the code with F8 to see where the error appears.

Have a look here to learn how to step through code in a loaded addin:
http://officeone.mvps.org/vba/howto_get_vba_code_from_addin.html
 
Steve

My problem was getting access to the AddIn to enable me to trap the error. I
had no idea that you could get access to an AddIn. I had been trying to trap
the error on the pot file but could not trap the error as the pot file has an
open presentation (itself) and the error related to no presentation being
open.

Many thanks for the "How to get VBA code from AddIn", I am now able to see
where it is tripping and resolve.

Regards
Jackie
 

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

Back
Top