Microsoft KB Archive/939051

= A VBA macro takes longer than expected to finish when you run the macro in Excel 2007 on a Windows Vista-based computer =

Article ID: 939051

Article Last Modified on 6/22/2007

-

APPLIES TO


 * Microsoft Office Excel 2007

-



SYMPTOMS
When you run a Microsoft Visual Basic for Applications (VBA) macro in Microsoft Office Excel 2007 on a Windows Vista-based computer, the macro takes longer than expected to finish.

Note This issue occurs if the macro makes many calls to the printer driver for page setup information, for screen display information, and so on.



CAUSE
This issue occurs because Windows Vista takes a while to make a call to a Unidrive printer driver. Therefore, the latency can double or triple the length of time that Windows Vista takes to run the code.



WORKAROUND
To work around this issue, follow these steps:
 * 1) Before you run the macro, store the current printer driver in a variable.
 * 2) Programmatically switch to a monolithic driver. For example, switch to the Microsoft Office Document Image Writer printer driver.
 * 3) At the end of the code or before the code that prints something, programmatically switch back to the stored printer driver to restore the computer to its original state.

Additional query words: XL2007

Keywords: kbtshoot kbexpertisebeginner kbprb KB939051

-

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

© Microsoft Corporation. All rights reserved.