ActiveX button's click event not being fired

  • Thread starter =?iso-8859-1?B?UultaQ==?=
  • Start date
?

=?iso-8859-1?B?UultaQ==?=

Hello.

I've worked a fair bit with MS Office, but mostly Access, Excel and
Word. I've never fiddled much with Powerpoint, nor programmed against
it. I expect this is beyond basic, but I can't seem to find the info I
need.

I'm using Powerpoint XP SP3. I've added an ActiveX button control to a
slide; the intent is to open an Excel file when/if the user clicks on
the button. No trouble with the VBA code - I've created my event
handler; right-click on the button, select "View Code", and I fall
right into the button's event handler, behind the slide.

But it appears that the button's event handler isn't getting fired at
all. (I have tested it while viewing the slide show, and not in design
mode.)

Is there something particular I need to do to make this happen?

Thanks,
Remi.
 
G

Guest

You might want to include the code you're trying to run.
If you just want to open an excel file from ppt you dont need code at all
just an action button (slide show > action buttons) with an on click action
of hyperlink > other file
 
?

=?iso-8859-1?B?UultaQ==?=

Thanks for the tip, John - that did it.

I hadn't included the code because I didn't think it was important.
Seems to me, the important thing was that it compiled and wasn't
getting called - regardless what the code was.

Here it is. I still would like to know what's going on, for future
reference:

Private Sub cmdOpenSheet_Click()
Dim objExcel As New Excel.Application
Dim objWB As New Excel.Workbook
MsgBox "Test - I'm running!"
Set objWB = objExcel.Workbooks.Open("F:\temp\TEST.xls")
objExcel.Visible = True
End Sub

This code runs fine in an Excel module. I threw in the MsgBox (after
having tried with a breakpoint) to confirm it was not running; I didn't
know if Powerpoint might hide or mask run-time errors.

Any ideas?

Thanks again for the note on Action buttons.

Remi.
 
?

=?iso-8859-1?B?UultaQ==?=

Actually:

Private Sub cmdOpenSheet_Click()
Dim objExcel As New Excel.Application
Dim objWB As Excel.Workbook
MsgBox "Test - I'm running!"
Set objWB = objExcel.Workbooks.Open("F:\temp\TEST.xls")
objExcel.Visible = True
End Sub

'Cause I know someone will note the unnecessary new.
 
S

Steve Rindsberg

It seems you've got your solution, but in case you find yourself needing to
invoke macros from a slide show later, use an action button or any other PPT
shape instead of an ActiveX control.

Rightclick the shape, choose Action Settings and assign it a Run Macro [choose
your subroutine ] action
 

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