Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to improve performance of VB.Net 2010 / Word Windows Desktop App?

How to improve performance of VB.Net 2010 / Word Windows Desktop App?

Scheduled Pinned Locked Moved Visual Basic
visual-studiocsharpcomperformance
7 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    QuickBooksDev
    wrote on last edited by
    #1

    We have a VB.Net 2010 Windows Desktop app that creates custom invoices for QuickBooks. The app uses the Microsoft.Office.Interop.Word reference. For each item in the invoice we copy a row or table in Word via MyTableRowRange.Copy() and pRow.Range.Paste() etc. Then Word.Find.Execute(Replace... to change the variables in a Template.Docx file to the real values. The problem is that it takes too long. Doing 2 invoices with a total of 200 items is taking over 30 minutes on a I3280 quad 3.6 with 8 threads and 16G ram. This is running from a regular exe not from the vs ide. Any ideas?

    M C 2 Replies Last reply
    0
    • Q QuickBooksDev

      We have a VB.Net 2010 Windows Desktop app that creates custom invoices for QuickBooks. The app uses the Microsoft.Office.Interop.Word reference. For each item in the invoice we copy a row or table in Word via MyTableRowRange.Copy() and pRow.Range.Paste() etc. Then Word.Find.Execute(Replace... to change the variables in a Template.Docx file to the real values. The problem is that it takes too long. Doing 2 invoices with a total of 200 items is taking over 30 minutes on a I3280 quad 3.6 with 8 threads and 16G ram. This is running from a regular exe not from the vs ide. Any ideas?

      M Offline
      M Offline
      Maciej Los
      wrote on last edited by
      #2

      Accordingly to actuall description of issue, using Copy and Paste then Replace function might cause performance issues. If you want to get more help, please, improve your question and post a bigger part of code.

      Q 1 Reply Last reply
      0
      • M Maciej Los

        Accordingly to actuall description of issue, using Copy and Paste then Replace function might cause performance issues. If you want to get more help, please, improve your question and post a bigger part of code.

        Q Offline
        Q Offline
        QuickBooksDev
        wrote on last edited by
        #3

        The code is scattered in out modules. Is there a better way of doing the word copy / paste and then replace? Also every time I paste code into this box the browser hangs up and I loose everything entered include just 1 line (i.e. CodeProject.com not responding).

        1 Reply Last reply
        0
        • Q QuickBooksDev

          We have a VB.Net 2010 Windows Desktop app that creates custom invoices for QuickBooks. The app uses the Microsoft.Office.Interop.Word reference. For each item in the invoice we copy a row or table in Word via MyTableRowRange.Copy() and pRow.Range.Paste() etc. Then Word.Find.Execute(Replace... to change the variables in a Template.Docx file to the real values. The problem is that it takes too long. Doing 2 invoices with a total of 200 items is taking over 30 minutes on a I3280 quad 3.6 with 8 threads and 16G ram. This is running from a regular exe not from the vs ide. Any ideas?

          C Offline
          C Offline
          Chris Quinn
          wrote on last edited by
          #4

          Look at doing a mailmerge into the Word document, with the QuickBooks DB as the data source

          ========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================

          Q 1 Reply Last reply
          0
          • C Chris Quinn

            Look at doing a mailmerge into the Word document, with the QuickBooks DB as the data source

            ========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================

            Q Offline
            Q Offline
            QuickBooksDev
            wrote on last edited by
            #5

            That would not work since much of the data is not in QuickBooks. The Docx Template is also very complex. (We do use mail merge that with other programs when it fits but not with QB as a source but from an extracted file). The program also will save as a PDF and email the invoice once the new Docx file is created. Really need to know how to speed up what we have currently. Are certain Word functions just extremely slow? Are there replacements that can be used.

            M 1 Reply Last reply
            0
            • Q QuickBooksDev

              That would not work since much of the data is not in QuickBooks. The Docx Template is also very complex. (We do use mail merge that with other programs when it fits but not with QB as a source but from an extracted file). The program also will save as a PDF and email the invoice once the new Docx file is created. Really need to know how to speed up what we have currently. Are certain Word functions just extremely slow? Are there replacements that can be used.

              M Offline
              M Offline
              Mycroft Holmes
              wrote on last edited by
              #6

              QuickBooksDev wrote:

              Are certain Word functions just extremely slow

              YES! It is why Office should never be used in a development environment, that and the versioning nightmare it creates. Personally I would use a proper reporting tool to generate the invoices. SSRS, Telerik, Dev Express all have excellent reporting tools that will use disparate data sources and produce the most complex output you could require.

              Never underestimate the power of human stupidity RAH

              Q 1 Reply Last reply
              0
              • M Mycroft Holmes

                QuickBooksDev wrote:

                Are certain Word functions just extremely slow

                YES! It is why Office should never be used in a development environment, that and the versioning nightmare it creates. Personally I would use a proper reporting tool to generate the invoices. SSRS, Telerik, Dev Express all have excellent reporting tools that will use disparate data sources and produce the most complex output you could require.

                Never underestimate the power of human stupidity RAH

                Q Offline
                Q Offline
                QuickBooksDev
                wrote on last edited by
                #7

                It is a bit late to change to something else. What Word interfaces are extremely slow and what can be done about it?

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups