I would be grateful if someone could tell me if I am declaring my arrays properly in my declaration statement so that they will be available in all of the macros and program.
With PowerPoint VBA my understanding is that if you want to access variables throughout the entire program then you declare them at the start (The Declaration). As far as I am aware this has worked perfectly with my non-array variables (e.g the integers), but unfortunately not for one particular set of arrays.
Below is my current declaration. For all of the non-arrays their values are retained when running different macros. However, the values of the TileAnswer() arrays have been lost when I try to access them in a different macro. I note that this macro has been called after the program user clicks a shape which has an action to activate the macro concerned. I note that the values go to zero as soon as this action has taken place. (No new code as been processed.) To confuse the matter further I have also used another set of arrays (shown as arraytest2) and they do not lose their values! I would be grateful for any advice or help as to what I should try!
Thank you!
Option Explicit
Dim Score, WrongClicks, StateofGame, ActiveRectangle1, ActiveRectangle2 As Integer
Dim TimeStart, TimeEnd As Date
Dim MyDocument As Slide
Dim oshp, oshp2 As Shape
Dim oeff As Effect
Dim oeff2 As Effect
Dim TileAnswer(16) As Integer
Dim arraytest2(2) As Integer