Does ppt remember VB variable values between slides?

  • Thread starter Thread starter barker
  • Start date Start date
B

barker

For example, I have a button on slide 2 that activates
some VB code. However, I want to first set the values of
some variables on slide 1, then go to slide 2 and use
those variable values in the VB code on slide 2. But, I
guess ppt doesn't remember the values I set for those
variables in slide 1. Is there a way to set values for
variables in one slide and remember them to use in VB code
in another slide? Thanks.
 
Thanks Shyam, but what do mean "public". I defined the
variables in a code module, but I still get an
error "invlaid outside procedure". Can you help. Thanks.
 
Barker,
You will need post your declaration. Something seems out of order. It should
be something along the lines...

Option Explicit
Public MyVar as Long
 
Barker,
From the help file:
If used, the Option Explicit statement must appear in a module before any
procedures.

When Option Explicit appears in a module, you must explicitly declare all
variables using the Dim, Private, Public, ReDim, or Static statements. If
you attempt to use an undeclared variable name, an error occurs at compile
time.

If you don't use the Option Explicit statement, all undeclared variables are
of Variant type unless the default type is otherwise specified with a
Deftype statement.

Note: Use Option Explicit to avoid incorrectly typing the name of an
existing variable or to avoid confusion in code where the scope of the
variable is not clear.

--
Regards
Shyam Pillai

Batch Exporter
http://www.mvps.org/skp/products/xport/
 
Back
Top