Excel and Powerpoint. VB code

J

Javier

I am trying to do the following:

I have a PPT presentation with a lot of input fields in
different slides. When I run the slide show, the user can
introduce different parameters in the input fields. The
whole presentation is linked to an Excel file. This file
processes the parameters and the output of the excel tool
is shown in one slide in the ppt presentation.

I have the following problem:

Where do I have to write the code to open the excel file,
so that the file is automatically opened when the slide
show begins, and so that I can access the variable
referring to this excel file from ANY slide in the
presentation?
The code would be something like this
Public appExcel As Excel.Application
Dim strxls As String
Set appExcel = GetObject(, "Excel.Application")
appExcel.Visible = False
strxls = "C:\Example.xls"
appExcel.Workbooks.Open (strxls)

I just dont know where to write this code so
that "appExcel" is really a global variable that can be
accessed from the code written in any slide of the
presentation.

....and a second question:
I always link the code in any slide to some "input
control" (command button, combobox, etc). However, I would
like some code to run automatically when I go to a new
slide (e.g. the code I write for slide #4 should run in
the transition from slide #3 to #4).

I would really appreciate any kind of help on the
questions above.

Best regards,
Javier
 

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