Macro definitions disappear

W

Wi11y13

I have created a 64 chart training package that runs in slide show mode
(PPSM). The last chart (via macro) asks for the student name and prints a
certificate for taking the training. When I created the chart itself I used a
macro to set up initial "name definitions" for the slide itself and for the
"name field" that the users input will be placed in on the certificate. I
then save this to slide show mode (PPSM). It all runs fine. But when I make a
change to any other chart in the package, the definitions seem to disappear
and the macro can no longer associate where the name field is located. In
order for it to work again I need to re-define (or re-name) the slide and the
text box for the name.

Does anyone know why this is happening and if there is a cure so I do not
have to continually run the naming macros for the slide and the text box
every time I make a change anywhere within the 64 charts?

By the way, I have had much help creating this entire macro package from
David M. Marcovitz on this site. I wanted to give him props for all the great
help.
 
W

Wi11y13

The code was offered by David M. Marcovitz:

___________________________________________________
Sub SetSlideName()
ActiveWindow.Selection.SlideRange.Name = _
InputBox("Name the slide")
End Sub

Sub SetShapeName()
ActiveWindow.Selection.ShapeRange(1).Name = _
InputBox("Name the shape")
End Sub

Sub AddNameToCertificate()
Dim userName As String

userName = InputBox("Type your name as you want it to appear on your
certificate ")
ActivePresentation.Slides("CertificateSlide").Shapes("CertificateName") _
.TextFrame.TextRange.Text = userName
End Sub
_______________________________________________________

I select the test box for instance on the chart and then "run" the macro
SetShapeName. I then save the presentation as a slide show .ppsm. During the
slide show I am able to enter a name and have it print on the certificate.
All works fine until I go back and edit the original .ppt charts (any chart
in the package) and re-save. Then the definitions go away and the macro can
no longer seem to associate where to put the entered name, until I go back to
the specified chart and re-run these 2 macros to redefine the box (and
slide), save it again and then it works.

Thanks for the help.
 
W

Wi11y13

Maybe that is my problem as I am saving and working in compatibility mode so
that some users who have not yet upgraded to 2007 can still utilize it.
 
J

John Wilson

I think I have seen reports of slide names being lost when you save as ppt.
If the certificate doesn't change (except for the name) maybe the slide and
shape NUMBER will work better in this case.

If the number of slides change put the cert as slide 1 and hide it.
--
john ATSIGN PPTAlchemy.co.uk

Free PPT Hints, Tips and Tutorials
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html
PPTLive Atlanta Oct 11-14 2009
 
D

David Marcovitz

I think I have seen reports of slide names being lost when you save as ppt.
If the certificate doesn't change (except for the name) maybe the slide and
shape NUMBER will work better in this case.

If the number of slides change put the cert as slide 1 and hide it.

Change that to slide 2, not slide 1. PowerPoint has a feature that when the
first slide is hidden, it still shows.
--David

--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 

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