Microsoft KB Archive/238984

= How To Improve the Performance of Office Automation Code =

Article ID: 238984

Article Last Modified on 2/12/2007

-

APPLIES TO


 * Microsoft Office XP Developer Edition
 * Microsoft Office 2000 Developer Edition
 * Microsoft Outlook 98 Standard Edition
 * Microsoft Visual C++ 6.0 Standard Edition

-



This article was previously published under Q238984



SUMMARY
You can improve the performance of your Automation code in Microsoft Visual C++ by using a two-dimensional variant SAFEARRAY to read and write data in one attempt, 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 are not aware that this data can usually be written or read in one attempt by using a two-dimensional variant SAFEARRAY.

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

186120 How To Use MFC to Automate Excel and Fill a Range with an Array

186122 How To Use MFC to Automate Excel and Obtain an Array from a Range

179706 How To 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, and then use Automation to tell the server to perform a paste operation. You can also tell the server to copy data to the clipboard, and then paste the data into your application.

Keywords: kbfaq kbhowto KB238984

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.