Setting references in VBA

N

Nickis

I am trying to write code in Excel to control Powerpoint. I located some
information that said to enable Excel to interact with other applications a
reference has to be set to the other application's object library. The info
said this could be done "in the Visual Basic Editor (VBE), select
References... from the Tools menu".

However, my "references" is greyed out so that I can't select it.

1) Not sure why?
2) Is this the only way I can get Excel to Control Powerpoint?

All I'm trying to do is a simple copy paste between applications, problem is
there's a lot of back and forth and I can't execute the Powerpoint code
automatically (from what I've read online so far), so I think controlling
from Excel is my best option.

Thanks for any insight.

Nicki
 
J

Joel

You can't set a reference while a macro is reunning. go to menu VBA Run -
Reset. the go and set the reference.
 
N

Nickis

What menu do I go to? I don't see a menu.

Joel said:
You can't set a reference while a macro is reunning. go to menu VBA Run -
Reset. the go and set the reference.
 
N

Nickis

Okay...I got it.

Another question re. references. I will be putting the Excel workbook with
the macros on a sharepoint server for multiple users to access. And possibly
individuals will have copies on their own machines. Will my Excel/powerpoint
macros still work or does the VBA reference also need to be set on the
server/other machines?

Thanks for any insight!
 
C

Chip Gorman

Okay...I got it.

Another question re. references.  I will be putting the Excel workbook with
the macros on a sharepoint server for multiple users to access.  And possibly
individuals will have copies on their own machines. Will my Excel/powerpoint
macros still work or does the VBA reference also need to be set on the
server/other machines?

Thanks for any insight!  

Read the article that Barb Reinhardt references. Also you could check
out
http://peltiertech.com/Excel/EarlyLateBinding.html
and
http://peltiertech.com/Excel/XL_PPT.html

I use the examples in the latter as the base for all my code that
controls powerpoint.
 
N

Nickis

Thanks that site was really useful and I'm actually beginning to understand
how it works! I've got it working but how do I change the following code to
go to a specific slide rather than the active slide.

Set PPSlide = PPPres.Slides
PPApp.ActiveWindow.Selection.SlideRange.SlideIndex)

I'm able to work with specific slides later in the string of code by using

PPApp.ActivePresentation.Slides.Range(Array(2)).Select

But I can't figure out how to change the PPSlide to a specific slide.
 
N

Nickis

Thanks! I stumbled through, learning a lot along the way and everything is
working great now!

Appreciate the guidance!

Nicki
 

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