HOWTO: Improving the Performance of Office Automation Code

ID: Q238984


The information in this article applies to:
  • Microsoft Visual C++, 32-bit Editions, versions 4.0, 5.0, 6.0
  • Microsoft Office 2000 Developer
  • Microsoft Outlook 98


SUMMARY

You can improve the performance of your Automation code in Visual C++ by using a two-dimensional variant SAFEARRAY to read and write data all at once, and by using the clipboard to copy and paste data.


MORE INFORMATION

A common cause of speed problems with Automation involves repetitive reading and writing of data. This is typical for Excel Automation clients. However, most people aren't aware that this data can usually be written or read all at once using a two-dimensional variant SAFEARRAY.

For additional information about using SAFEARRAY and helpful examples, please click the article numbers below to view the articles in the Microsoft Knowledge Base:

Q186120 HOWTO: Use MFC to Automate Excel and Fill a Range with an Array
Q186122 HOWTO: Use MFC to Automate Excel and Obtain an Array from a Range
Q179706 HOWTO: Use MFC to Automate Excel and Create/Format a New Workbook
Also, using the clipboard can sometimes improve performance. For instance, you can copy your data to the clipboard, then use Automation to tell the server to perform a paste operation. Or vice- versa; you can tell the server to copy data to the clipboard, and then paste it into your application.

Additional query words:

Keywords : kbOutlook kbVC kbVC400 kbVC500 kbVC600 kbOffice2000
Version : WINDOWS:98; winnt:4.0,5.0,6.0; :
Platform : WINDOWS winnt
Issue type : kbhowto


Last Reviewed: October 7, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.