How to improve performance of VB.Net 2010 / Word Windows Desktop App?
-
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?
-
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?
Accordingly to actuall description of issue, using
Copy
andPaste
thenReplace
function might cause performance issues. If you want to get more help, please, improve your question and post a bigger part of code. -
Accordingly to actuall description of issue, using
Copy
andPaste
thenReplace
function might cause performance issues. If you want to get more help, please, improve your question and post a bigger part of code.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).
-
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?
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. =========================================================
-
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. =========================================================
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.
-
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.
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
-
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
It is a bit late to change to something else. What Word interfaces are extremely slow and what can be done about it?