Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Mar 2005
    Location
    Kent, England
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Error on PowerPoint Toolbar (Office 2003)

    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 on the toolbar 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.
    Jack

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Error on PowerPoint Toolbar (Office 2003)

    Can you provide some details? What is the code behind the buttons that fail?

  3. #3
    2 Star Lounger
    Join Date
    Mar 2005
    Location
    Kent, England
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error on PowerPoint Toolbar (Office 2003)

    Morning Hans

    Apologies for not being more descriptive. The buttons on the toolbar open userforms - if a document is not open and the user clicks on one of the buttons the error occurs.

    I have tried to trap the error by placing code on the "On Action" section of the button but the trap does not appear to work. As the template is a ppa I am unable to step through the code. If I open the pot file and set the document count as 0 then I do not get the error.

    Very odd !!

    Regards
    Jack

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Error on PowerPoint Toolbar (Office 2003)

    I don't know much about PowerPoint VBA, so I fear I can't help you. It would make it easier for others to help you if you could post a small demo.

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Error on PowerPoint Toolbar (Office 2003)

    Without opening PPT and checking help this is quite rough, but you could have your procedures start by doing something like this:

    if presentations.count = 0 then
    msgbox "You need to open a presentation first.", vbInformation+vbOkonly
    exit sub
    end if

  6. #6
    2 Star Lounger
    Join Date
    Mar 2005
    Location
    Kent, England
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error on PowerPoint Toolbar (Office 2003)

    I have placed a presentation count on Userform Initialise, which didn't work unfortunately. I have also placed a Message Box where the code calls the "On Action" function relevant to the button. The Message Box does not run, which would mean that the error is occurring before the "On Action" function is running. Also, there is no error number so I can't trap it that way either !!

    The issue with this particular template is that I need to create a ppa from the pot file and you can't step through a ppa file. If I run the code through the pot I will not get the error as a presentation is open (presentation being the pot file).

    I have a terrible feeling I'm going to have to forward this query to Microsoft !!

    Regards
    Jack

  7. #7
    2 Star Lounger
    Join Date
    Mar 2005
    Location
    Kent, England
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error on PowerPoint Toolbar (Office 2003)

    (Edited by HansV to make URL clickable - see <!help=19>Help 19<!/help>)

    Morning

    The above problem has now been solved. As per my previous message, the issue I had was getting access to the AddIn, so that I could step the code. I had no idea that you could get access to an AddIn but I have since learnt that you can, so now I am in a position where I can trap the error. Link to accessing an AddIn below (just in case you were interested):

    http://officeone.mvps.org/vba/howto_get_vb...from_addin.html

    Many thanks for your help
    Jack

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •