View Single Post
 
Old 03-31-2012, 05:29 PM
BBBenj BBBenj is offline Windows 7 32bit Office 2007
Novice
 
Join Date: Mar 2012
Posts: 3
BBBenj is on a distinguished road
Default Solved!

Coucou !

After a lot of research, here, there, everywhere, after testing, and testing and testing, finally I know what is going wrong.

Here is my initial code:
Code:
           ActiveWindow.Selection.SlideRange.Shapes.AddShape(msoShapeOval, x1, y1, x2, y2).Select
            With ActiveWindow.Selection.ShapeRange
               .Fill.Visible = msoTrue
               .Fill.Solid
               .Fill.ForeColor.SchemeColor = ppForeground
               .Line.Weight = 0.5
               .Line.Visible = msoTrue
               .Line.ForeColor.SchemeColor = ppBackground
               .Line.BackColor.RGB = RGB(255, 255, 255)
            End With
I found what was responsible of the total slow down of my macro: SELECT. It seems to work as if it selects ALL the object on my slide... Therefore the more objects, the more time to select all of them!

So, here is the solution, very close to initial code:
Code:
                With ActiveWindow.Selection.SlideRange.Shapes.AddShape(msoShapeOval, x1, y1, x2, y2)
                     .Fill.Visible = msoTrue
                     .Fill.Solid
                     .Fill.ForeColor.SchemeColor = ppForeground
                     .Line.Weight = 0.3
                     .Line.Visible = msoTrue
                     .Line.ForeColor.SchemeColor = ppBackground
                     .Line.BackColor.RGB = RGB(255, 255, 255)
                 End With
Now, everything goes well and I'm happy as I divided working time by a THOUSAND!!!

I hope it will help someone else.
Reply With Quote