Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-21-2016, 02:30 AM
jpl jpl is offline VBA and shapes very slow Windows 7 64bit VBA and shapes very slow Office 2010 32bit
Advanced Beginner
VBA and shapes very slow
 
Join Date: Jan 2016
Location: France
Posts: 33
jpl is on a distinguished road
Default VBA and shapes very slow

Bonjour
Je maitrise mal votre langue, et je m'en excuse.
Le texte qui suit est issu d'une traduction automatique, et il peut ne pas être clair.

I use Word VBA to insert numerous shape objects in documents.
Under Word 2003, the macro run in a immediate way.
But under Word 2010, these macros are in practice unusable because their execution can be very slow.
Here is an example:

Code:
 Sub MesureDuree()
        Dim i As Long, Boite As Shape, Debut As Date
        Debut = Time
        For i = 1 To 100
            'Set Boite = Me.Shapes.AddTextbox(msoTextOrientationHorizontal, 4 * i, 72.75, 4, 19.5)
            Set Boite = Me.Shapes.AddShape(msoShapeRectangle, 4 * i, 72.75, 4, 19.5)
            Boite.Fill.ForeColor.RGB = RGB(2 * i, 2 * i, 2 * i)
        Next i
        MsgBox CStr((Time - Debut) * 24 * 3600) & " s"
    End Sub
I open a new document under Word 2010 and I paste the macro in ThisDocument. The execution lasts 6 seconds.
If I register(record) the new document in the size(format) Word 2003 (extension .doc, i.e. in mode(fashion) of compatibility) before throwing(launching) the macro, the execution is immediate.
For the version with Textbox, the run time in Word 2010 achieves 50 seconds!


What changed between both versions of Word to have such a slowing down, and can one avoid him while leaving the document with the format 2010?



J'utilise Word VBA pour insérer de nombreux objets shape dans des documents.
Sous Word 2003, les macros s'exécutent de façon instantanée.
Mais sous Word 2010, ces macros sont en pratique inutilisables car leur exécution peut être très lente.
Voici un exemple :
....
J'ouvre un nouveau document sous Word 2010 et je colle la macro dans ThisDocument. L'exécution dure 6 secondes.
Si j'enregistre le nouveau document au format Word 2003 (extension .doc, c.-à-d. en mode de compatibilité) avant de lancer la macro, l'exécution est immédiate.
Pour la version avec Textbox, le temps d'exécution en Word 2010 atteint 50 secondes !
Qu'est ce qui a changé entre les deux versions de Word pour avoir un tel ralentissement, et peut on l'éviter tout en laissant le document au format 2010 ?
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA and shapes very slow shapes in header mhagi Word VBA 2 10-16-2015 12:21 AM
VBA and shapes very slow Slow internet = Slow Word... User12344321 Word 4 09-21-2015 12:54 PM
All Shapes on slide excelledsoftware PowerPoint 9 09-15-2013 04:03 AM
VBA and shapes very slow Where did map shapes go? SueK PowerPoint 1 01-20-2011 04:30 AM
My Shapes some appear some don't Jean-Paul Visio 0 03-01-2006 01:38 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:56 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft