E
EricG
I have a fairly simple VBA PowerPoint tool that reads in some data from an
Excel worksheet and "charts" it by creating a new PowerPoint slide and then
adding drawing objects, text boxes, etc to the slide, creating a simple
schedule chart. I usually have an Excel file with two or three worksheets
that I want to chart, and run times are generally very quick. However...
I recently discovered that if I run this routine through several times in a
row during a single run (using the same Excel data for each run and creating
exactly the same slide each run), then the run time to create a new slide
increases dramatically as the VBA runs. An example is given below, where I
ran my routine 40 times, creating 40 new slides (starting with a blank PPT
presentation). The final slide took sixteen (16) times longer to draw than
the first!
I can't tell if this is a VBA issue or a PowerPoint issue. My code is long,
ugly and not worth posting here. Do any of you have any ideas that would
explain why the per-slide run times increase so much when I run through the
loop 40 times versus one or two times?
Time to Create Slide (sec):
1.48
2.11
2.34
2.67
2.84
3.11
3.31
3.62
4.03
4.39
4.64
5.01
5.34
5.79
7.04
7.65
8.37
8.70
9.15
11.29
11.39
12.74
13.52
13.85
14.33
15.32
15.75
16.55
17.41
18.24
18.71
19.32
19.84
20.95
21.26
21.71
22.16
22.91
23.62
24.01
Thanks in advance,
Eric
Excel worksheet and "charts" it by creating a new PowerPoint slide and then
adding drawing objects, text boxes, etc to the slide, creating a simple
schedule chart. I usually have an Excel file with two or three worksheets
that I want to chart, and run times are generally very quick. However...
I recently discovered that if I run this routine through several times in a
row during a single run (using the same Excel data for each run and creating
exactly the same slide each run), then the run time to create a new slide
increases dramatically as the VBA runs. An example is given below, where I
ran my routine 40 times, creating 40 new slides (starting with a blank PPT
presentation). The final slide took sixteen (16) times longer to draw than
the first!
I can't tell if this is a VBA issue or a PowerPoint issue. My code is long,
ugly and not worth posting here. Do any of you have any ideas that would
explain why the per-slide run times increase so much when I run through the
loop 40 times versus one or two times?
Time to Create Slide (sec):
1.48
2.11
2.34
2.67
2.84
3.11
3.31
3.62
4.03
4.39
4.64
5.01
5.34
5.79
7.04
7.65
8.37
8.70
9.15
11.29
11.39
12.74
13.52
13.85
14.33
15.32
15.75
16.55
17.41
18.24
18.71
19.32
19.84
20.95
21.26
21.71
22.16
22.91
23.62
24.01
Thanks in advance,
Eric