Search code examples
vbapowerpoint

Will 20+ variables affect the performance of my PowerPoint presentation?


I am creating an interactive PowerPoint presentation in which students will complete matching activities, multiple-choice quizzes, etc. The presentation will record each student's progress, updating their averages and keeping track of how well they're doing with each type of question/activity.

I've made smaller, simpler files that worked great and used fewer than 5 public variables. So far in THIS presentation I think I will need about 25 public integer, long and string variables, plus local variables for some procedures. (25 altogether, not 25 for each type)

I looked up the required memory for each variable type, and the total memory for the variables I think I'll need is somewhere in the ballpark of 120 bytes, plus the length of the string variables. But I don't actually know what that MEANS.

It's probably a silly question (sorry), but I have no idea if my computer will look at that 120+ bytes and say "Sorry, dude. I'm not a miracle worker," or "Pffft, is that all? Easy-peasy!"

It seems like a small number to me, but this will be a pretty hefty presentation with each slide having 70 to 100 shapes (many with animations applied), and who knows how many slides total, so it seems like even small things might add up and cause performance issues.

I would just like to know if I need to look into some other way of manipulating/recording the data before I jump in and start trying to put it all together.

So, will this many public variables slow down my presentation?


Solution

  • Using 25 variables in your code will have no measurable effect on speed or anything else unless you're storing massive amounts of text in string variables.

    Whether what you have in mind is the best way of accomplishing the task? As @Shawn says, we'd need to see the code or at least the general plan of attack before commenting on that, but I wouldn't worry about the number of variables. Most of my PPT add-ins use way more than the number of variables you're considering.