Powerful PowerPoint for Educators: Using Visual Basic for Applications to Make PowerPoint Interactive


Download 1.37 Mb.
Pdf ko'rish
bet175/191
Sana08.05.2023
Hajmi1.37 Mb.
#1442581
1   ...   171   172   173   174   175   176   177   178   ...   191
Bog'liq
2.2. Powerful PowerPoint For Educators

Mul ti ple Mod ules
You were warned early in this book that you should have only one module
for each presentation. If you have gotten this far in the book, you have prob ably
heeded that warning. However, some peo ple get con fused and add a second
module. Some things will work with more than one mod ule, and some things
won’t. Check the Project win dow to be sure that you have only one mod ule. If
you can’t re member how to check the mod ules in your Pro ject win dow, look
back at Chapter 4 in “Help! I’ve Lost My Windows.”
Usually, when you add one mod ule, it will be named “Module1.” How ever,
if you played around with modules or accidentally de leted a mod ule, your mod -
ule might be “Module2” or “Module3.” That is OK as long as there is only one
module, whatever it is named. If you have put code in more than one mod ule, use
cut and paste to move all the code into one mod ule. If you had 
Dim
state ments at
the top of each mod ule, be sure you put them all together at the top of your one
module and re move any duplicates.
168 De bug ging Tips


Du pli cate Vari ables
When we de clare our variables at the be ginning of a mod ule, we cre ate a
box to put in formation in, and we give that box a name. What if two boxes have
the same name? That would be a prob lem, and VBA would not know what to do.
In fact, noth ing in your module would work at all. You could have buttons tied to 
procedures that have noth ing to do with the variable that is de clared twice, but
they would not work. Noth ing would work.
You might have this problem if you are combining two examples or have a
long list of variables that you de clare at the beginning of your module, and you
forgot you al ready de clared a vari able. If none of your VBA works, check the
variable dec larations at the beginning of the mod ule and de lete any du plicate

Download 1.37 Mb.

Do'stlaringiz bilan baham:
1   ...   171   172   173   174   175   176   177   178   ...   191




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling