Word Automation Speed Slow

Discussion in 'Word VBA' started by DDJ, Jan 26, 2005.

  1. DDJ

    DDJ Guest

    I took a look at this ng's FAQs and could only locate one article (by Daryl
    Lucas) with some pointers regarding speeding up Word Automation from VB6.
    These were fairly limited in scope...can anyone point me to some more
    detailed discussions on how to speed up Word Automation? Seems like it's
    really slow from the testing I've done so far (creating tables in code seems
    to be the worst).

    Dan
     
    DDJ, Jan 26, 2005
    #1
    1. Advertising

  2. DDJ

    DDJ Guest

    Thanks for your response.

    We are primarily taking data from a table used by our program and writing
    the data to a report created using Word.

    To give an example...one report requires the building of approx. 10, five
    colum tables to output a two page report. Without having actually measured
    the time it takes, I can say that it seems to take quite a long time, in the
    range of 30 seconds or more. This, for a report that I wouldn't consider
    terribly long.

    I have been sticking with using Range objects; screen updating is switched
    off; and Word is hidden (at least until the document has finished processing
    and is opened in Preview mode).

    One area in which I was hoping there would be a more efficient way to
    proceed...the examples I'm using (from various help files, etc.), show each
    Word table being populated cell by cell, from row to row (the "Z" pattern)
    using "For Each" iterations. Is this really the fastest way to go? The
    same goes for formatting these cells. I think I can probably learn ways to
    format the larger pieces (say at the table level) that are faster than doing
    so at a lower level (the cell level).

    Any input appreciated.

    Dan

    "Jezebel" <> wrote in message
    news:OE%...
    > Perhaps you could explain a little more of the issues you're dealing with?
    > Word automation isn't normally very slow unless you're doing silly things
    > like working intensively with the Selection object, using the Windows and
    > Panes objects, and forcing Word to repaginate continually. Some basic
    > tips --
    >
    > - Work exclusively with Range objects. Use the Selection only for direct
    > interaction with the user.
    >
    > - Work with screen updating switched off or, better still, with the

    document
    > or Word itself hidden.
    >
    > Apart from that, VBA coding, as far as performance goes, is subject to the
    > same general principles as VB coding: check the VB forums and discussion
    > sites.
    >
    >
    > "DDJ" <> wrote in message
    > news:FwBJd.32$...
    > > I took a look at this ng's FAQs and could only locate one article (by

    > Daryl
    > > Lucas) with some pointers regarding speeding up Word Automation from

    VB6.
    > > These were fairly limited in scope...can anyone point me to some more
    > > detailed discussions on how to speed up Word Automation? Seems like

    it's
    > > really slow from the testing I've done so far (creating tables in code

    > seems
    > > to be the worst).
    > >
    > > Dan
    > >
    > >

    >
    >
     
    DDJ, Jan 26, 2005
    #2
    1. Advertising

  3. DDJ

    Jay Freedman Guest

    A couple more tips:

    - In general, build as much of the automation as possible in macros
    within VBA, and call them from VB. The OLE interface between VB and
    VBA is often the slowest part of the operation, so minimize the
    message-passing between them.

    - For tables specifically, the fastest method is usually to build up
    the text of the table as ordinary text, with tabs between columns and
    a paragraph mark at the end of each row. When it's all ready, use
    ConvertTextToTable. Also see
    http://www.word.mvps.org/FAQs/TblsFldsFms/FastTables.htm.

    --
    Regards,
    Jay Freedman
    Microsoft Word MVP FAQ: http://word.mvps.org

    On Wed, 26 Jan 2005 12:49:20 +1100, "Jezebel"
    <> wrote:

    >Perhaps you could explain a little more of the issues you're dealing with?
    >Word automation isn't normally very slow unless you're doing silly things
    >like working intensively with the Selection object, using the Windows and
    >Panes objects, and forcing Word to repaginate continually. Some basic
    >tips --
    >
    >- Work exclusively with Range objects. Use the Selection only for direct
    >interaction with the user.
    >
    >- Work with screen updating switched off or, better still, with the document
    >or Word itself hidden.
    >
    >Apart from that, VBA coding, as far as performance goes, is subject to the
    >same general principles as VB coding: check the VB forums and discussion
    >sites.
    >
    >
    >"DDJ" <> wrote in message
    >news:FwBJd.32$...
    >> I took a look at this ng's FAQs and could only locate one article (by

    >Daryl
    >> Lucas) with some pointers regarding speeding up Word Automation from VB6.
    >> These were fairly limited in scope...can anyone point me to some more
    >> detailed discussions on how to speed up Word Automation? Seems like it's
    >> really slow from the testing I've done so far (creating tables in code

    >seems
    >> to be the worst).
    >>
    >> Dan
    >>
    >>

    >
     
    Jay Freedman, Jan 26, 2005
    #3
  4. DDJ

    DDJ Guest

    Thanks all for the comments/suggestions.

    I played with this today using some of the suggestions on the MVP site and
    was able to reduce the time it takes to process tables significantly (very
    significantly!).

    Now I'm working trying to figure out how to reduce the resource consumption.
    The CPU goes to 100% while the document is being written in code, then
    (oddly) stays at 100% for a long time (60 to 120) seconds after that (I'm
    using a table with five columns and 1000 rows for testing purposes). Any
    thoughts here would be appreciated.

    Dan

    "DDJ" <> wrote in message
    news:FwBJd.32$...
    > I took a look at this ng's FAQs and could only locate one article (by

    Daryl
    > Lucas) with some pointers regarding speeding up Word Automation from VB6.
    > These were fairly limited in scope...can anyone point me to some more
    > detailed discussions on how to speed up Word Automation? Seems like it's
    > really slow from the testing I've done so far (creating tables in code

    seems
    > to be the worst).
    >
    > Dan
    >
    >
     
    DDJ, Jan 26, 2005
    #4
  5. DDJ

    Alex_P Guest

    We have applications written in VB6 which are producing large 200 - 500 pages
    word documents with a lot of content, such as : pictures, tables, styles,
    etc. After installation of MS Word 2003 the performance decreased
    tremendously, from 40 min to 4 hours per 200 pages. We also noticed that as
    document gets bigger, then we begin to notice slowing down. We contacted
    Microsoft, but haven't heard the from them

    "DDJ" wrote:

    > I took a look at this ng's FAQs and could only locate one article (by Daryl
    > Lucas) with some pointers regarding speeding up Word Automation from VB6.
    > These were fairly limited in scope...can anyone point me to some more
    > detailed discussions on how to speed up Word Automation? Seems like it's
    > really slow from the testing I've done so far (creating tables in code seems
    > to be the worst).
    >
    > Dan
    >
    >
    >
     
    Alex_P, Feb 14, 2005
    #5
  6. DDJ

    AlexP Guest

    We have application written in VB 6.0 which costructs large Word documents
    200 -500 pages with a lot of content, such as: pictures, tables, styles, etc.
    It was taking about 40 min to build 200 pages document. We had used this
    application from Word 97 to Word 2002. Recently we had our stations upgraded
    with Office 2003 and we have experienced tremendous performance degrade. It
    took about 4 hours to do the same document. Is anybody aware what happens? We
    have contacted Microsoft, but so far we have not received an answer.

    "DDJ" wrote:

    > I took a look at this ng's FAQs and could only locate one article (by Daryl
    > Lucas) with some pointers regarding speeding up Word Automation from VB6.
    > These were fairly limited in scope...can anyone point me to some more
    > detailed discussions on how to speed up Word Automation? Seems like it's
    > really slow from the testing I've done so far (creating tables in code seems
    > to be the worst).
    >
    > Dan
    >
    >
    >
     
    AlexP, Feb 14, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Plumdodge

    Open form speed vs Navigation speed

    Plumdodge, Jun 16, 2006, in forum: Access Forms
    Replies:
    3
    Views:
    71
    Klatuu
    Jun 16, 2006
  2. Arvin Meyer [MVP]

    how to incress my system speed & internet accesing speed

    Arvin Meyer [MVP], Oct 11, 2009, in forum: Access Beginners
    Replies:
    0
    Views:
    78
    Arvin Meyer [MVP]
    Oct 11, 2009
  3. Dale

    Print Preview Speed/Report Speed

    Dale, Jun 26, 2009, in forum: Access Reports
    Replies:
    1
    Views:
    88
    Mark Andrews
    Jun 27, 2009
  4. Ryan W

    Can you speed UP drag speed?

    Ryan W, Oct 24, 2005, in forum: Excel Misc
    Replies:
    1
    Views:
    85
    bpeltzer
    Oct 24, 2005
  5. Thanks to AT&T

    WORD 2002 - slow slow slow

    Thanks to AT&T, Sep 20, 2004, in forum: Word Errors
    Replies:
    5
    Views:
    98
    Suzanne S. Barnhill
    Sep 27, 2004
Loading...

Share This Page