Microsoft KB Archive/220684

= OFF2000: Error Or Unexpected Results Using SetFocus Method on Commandbar =

Article ID: 220684

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft Excel 2000 Standard Edition
 * Microsoft PowerPoint 2000 Standard Edition
 * Microsoft Word 2000 Standard Edition

-



This article was previously published under Q220684



SYMPTOMS
If you run a Microsoft Visual Basic for Applications macro that sets the focus of a command bar by using the SetFocus method, you may see the following behavior depending on which program you are using:

PowerPoint 2000
You may receive the following error in Powerpoint 2000:

Run-time error '-2147467259(800004005)':

Method 'SetFocus' of object 'CommandBarControl' failed

Excel 2000 and Word 2000
The command bar may not be selected as expected.



CAUSE
This behavior occurs when you run a Microsoft Visual Basic for Applications macro that sets the focus to a command bar that is disabled, or is not visible. Since the control is disabled or is not visible, the SetFocus method fails.



MORE INFORMATION
In Microsoft Visual Basic for Applications, you cannot set the focus to a command bar that is disabled, or is not visible.

Additional query words: OFF2000 CommandBars Controls

Keywords: kbbug kbnofix KB220684

-

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

© Microsoft Corporation. All rights reserved.