From: wwwilli on
Hi.
We had a global VBA macro for file naming, saving, and retrieving in company
project folders. That macro was used in different Office 2000 applications
identically. For each application there was a slightly different way to
install, distribute and start that macro without bothering the individual
users too much. So we had the macro in normal.dot, and in a hidden .xls in
....\xlstart. Plus a macro button in a toolbar. In PowerPoint you could open
the .ppt with the VBA project, make the button, close the .ppt file, and from
now on you could start the macro with or without the VBA project file being
opened. Even an externally updated VBA project could be started that way.
Now the whole company moved to Office 2007, and PowerPoint dos not accept
this to work. I tried what I can, but I do not find a way to start that
"global" macro without opening the VBA project file (which is a .pptm or
..potm). The idea ist so simple, and in PowerPoint 2000 it was simple. Why not
in 2007?
I do not know if it is necessary to got into AddIns, it was not in 2000.
Anyway, when I try to store the .potm file as .ppam it says "could not be
compiled" (whereas the macro itself runs without any problems). Whatever I
try, afterwards the macro "cannot be found". I tried each security option
there is.

Could you help me? I'd already be happy if only a very small global (maybe
autoexec) macro could open the mentioned .potm VBA project file, so that the
user does not have to click all the way through % appdata % before he can use
the large macro...
Regards,
wwwilli
From: Steve Rindsberg on
>> In PowerPoint you could open
> the .ppt with the VBA project, make the button, close the .ppt file, and from
> now on you could start the macro with or without the VBA project file being
> opened.

You could, yes, but it wasn't the recommended or supported way to do things.

> I do not know if it is necessary to got into AddIns, it was not in 2000.

Not necessary but recommended in 2000. As you've found, possibly necessary in
2007. It's not that complicated.

> Anyway, when I try to store the .potm file as .ppam it says "could not be
> compiled" (whereas the macro itself runs without any problems).

That can happen, yes. You can force the code to compile from the IDE before
saving as a PPA/PPAM. If you do that, it'll stop and highlight whatever line of
code has disturbed its peace of mind so you can correct it and try again until
you get a clean compile. THEN save as an add-in.

Chances are that if you ran into a compile error when saving as an add-in, your
users would eventually run into it when running your code. Better to learn of
the error up front when you can correct it easily.

> Could you help me? I'd already be happy if only a very small global (maybe
> autoexec) macro

PPT doesn't have autoexec macros, except in add-ins.
Writing an add-in is only a wee bit more complex than doing what you're already
doing and will save you all of the problems you're trying to solve. And once the
add-in is installed, it will become part of PPT until it's uninstalled. The user
won't have to go searching for anything ever.



> could open the mentioned .potm VBA project file, so that the
> user does not have to click all the way through % appdata % before he can use
> the large macro...


==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/

PPTools add-ins for PowerPoint
http://www.pptools.com/


From: windhello on
maybe you can use this software :E.M. PowerPoint Video Converter .
it is an all-in-one PowerPoint to video converter. It can convert
PowerPoint presentations to almost all popular video formats such as
AVI, MPEG, MPEG2 TS, MP4, WMV, 3GP.
http://www.effectmatrix.com/PowerPoint-Video-Converter/index.htm
From: wwwilli on
Hi Steve,
thanks for your answer. I am seeing a little clearer now.
One point: If my "large" code (of over 10000 lines) must be compilable
inside the IDE than I will never make an AddIn out of this. This macro runs
under different MS Office applications plus AutoCAD and others. It contains
AutoCAD objects, Excel objects, Word objects, and so forth. These lines are
never reached by the "false" applications because they are isolated to
special subroutines. I have even subroutines for AutoCAD after 2007 and
others for AutoCAD before 2007. This system works fine in the normal macro
execution. But the compilation in PowerPoint IDE will not accept a line like
Na = ThisDrawing.ActiveLayout.Name, even if PowerPoint VBA could never reach
the subroutine or function containing this line (except with a programming
error).

So my question is now, could it be possible anyway to make a PP AddIn from
this code, maybe by deactivating the macros, opening the .potm, and saving
the .ppam?
Or will I have to concentrate on the "small" solution containing only the
three lines to identify the active window, open the large VBA project and
activate the former window? I tried the first, but did not succeed.
Trying to make a PP AddIn I reduced my code to msgbox "hello". But PP told
me always "macro could not be found". Could you lead my hand? Or give me 2000
back?

> It's not that complicated.

So give me the light.

Regards,
wwwilli

From: Steve Rindsberg on
In article <9460C292-B9A0-44DC-86C0-548BD15135B0(a)microsoft.com>, Wwwilli wrote:
> Hi Steve,
> thanks for your answer. I am seeing a little clearer now.
> One point: If my "large" code (of over 10000 lines) must be compilable
> inside the IDE than I will never make an AddIn out of this. This macro runs
> under different MS Office applications plus AutoCAD and others. It contains
> AutoCAD objects, Excel objects, Word objects, and so forth. These lines are
> never reached by the "false" applications because they are isolated to
> special subroutines.

It's hard to make suggestions w/o knowing what it does or how, but if there's
code that never runs under PowerPoint, couldn't you pull that out to a different
file and leave just the PPT bits within PPT?

You can certainly automate other apps from within PPT.

> I have even subroutines for AutoCAD after 2007 and
> others for AutoCAD before 2007. This system works fine in the normal macro
> execution. But the compilation in PowerPoint IDE will not accept a line like
> Na = ThisDrawing.ActiveLayout.Name, even if PowerPoint VBA could never reach
> the subroutine or function containing this line (except with a programming
> error).

You can probably get around this by declaring Na and ThisDrawing as generic
Objects. VBA knows that it doesn't know the properties of Objects in advance,
so it doesn't throw compile errors when it doesn't understand their properties.
It leaves it up to you to make sure they're correct.

> So my question is now, could it be possible anyway to make a PP AddIn from
> this code, maybe by deactivating the macros, opening the .potm, and saving
> the .ppam?

Easy enough to test ... start by saving it to a new file so you don't destroy
any existing work, then comment out or delete any code that's not intended to
run within PPT.

Have a look here as well ... you'll need a way to trigger the macros:

Create an ADD-IN with TOOLBARS that run macros
http://www.pptfaq.com/FAQ00031.htm

> Or will I have to concentrate on the "small" solution containing only the
> three lines to identify the active window, open the large VBA project and
> activate the former window? I tried the first, but did not succeed.
> Trying to make a PP AddIn I reduced my code to msgbox "hello". But PP told
> me always "macro could not be found".

When you did what, exactly? How did you attempt to run the macro?
Macros within an add-in don't appear in the Macros dialog box, for example.


Could you lead my hand? Or give me 2000
> back?
>
> > It's not that complicated.
>
> So give me the light.
>
> Regards,
> wwwilli


==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/

PPTools add-ins for PowerPoint
http://www.pptools.com/