Thread: [Solved] VBA and shapes very slow
View Single Post
 
Old 02-16-2016, 05:39 AM
jpl jpl is offline Windows 7 64bit Office 2010 32bit
Advanced Beginner
 
Join Date: Jan 2016
Location: France
Posts: 33
jpl is on a distinguished road
Default

Hello

Here are the results I obtain for diverse versions of the macro:

Original macro (post # 1), modified to draw 500 rectangles: 108 seconds.
Macro modified by macropod (post # 17): 90 seconds
Macro (post # 5): 3 seconds.

I modified the macro of the message 17 in the following way:

Code:
...
    With DocTmp
      .Windows(1).Visible = False
      For i = 1 To 500
    ...
The macro runs in 5 seconds.

With Word 2003, the original macro runs in 1 second. Moreover, the original macro, adapted for Excel, runs in 0 seconds with Excel 2010!

There is apparently a problem of Shape objects handling in word 2010. It is surprising that nobody speaks about it on the Internet.

Thank you for your help.

Bonjour
Voici les résultats que j'obtiens pour diverses versions de la macro :
macro originale (message 1), modifiée pour dessiner 500 rectangles : 108 secondes
macro modifiée par macropod (message 17) : 90 secondes
macro (message 5) : 3 secondes.
J'ai modifié la macro du message 17 de la façon suivante :

La macro s'exécute en 5 secondes.
Avec Word 2003, la macro originale prend 1 seconde. Par ailleurs, la macro originale, adaptée pour Excel, s'exécute en 0 seconde avec Excel 2010 !
Il y a visiblement un problème de maniement des objets Shape en Word 2010. Il est surprenant que personne n'en parle sur Internet.
Merci pour votre aide
Reply With Quote