XL: Hiding Chart Toolbar with an XLM Macro FailsLast reviewed: February 2, 1998Article ID: Q99519 |
The information in this article applies to:
SYMPTOMSIn the versions of Microsoft Excel listed above, if you create or activate a chart and then attempt to hide the chart toolbar in the same macro, the command to hide the toolbar may be applied to the worksheet window rather than the chart window. This results in the toolbar continuing to be displayed while the chart window is active. If you set the chart toolbar so that it would be displayed in a worksheet window, it will now be hidden.
WORKAROUNDWhenever a chart window is opened or activated in Microsoft Excel, the chart toolbar is automatically displayed by default. To change this default, you must disable the chart toolbar while a chart window is active. Once this is done, when you open or activate a chart, the toolbar will no longer be displayed. If you have not changed this default and you run the following macro to create a chart and hide the chart toolbar
Create_Chart =NEW("Chart") =SHOW.TOOLBAR(4,FALSE) =RETURN()the chart toolbar will continue to be displayed with the chart window active and will be designated as hidden for the worksheet window. The macro that creates the chart needs to return before the SHOW.TOOLBAR(4,FALSE) command is executed. You can accomplish this by using the ON.TIME() function. ON.TIME() runs a designated macro at a specified time. It begins tracking the time when the macro return is reached and Microsoft Excel is in Ready mode. In the following macro sequence, the Hide_Toolbar macro will run 1 second after the Create_Chart macro returns:
Create_Chart =NEW("Chart") =ON.TIME(NOW()+"00:00:01","Hide_Toolbar") =RETURN() Hide_Toolbar =SHOW.TOOLBAR(4,FALSE) =RETURN() STATUSThis is by design of the versions of Microsoft Excel listed at the beginning of this article.
MORE INFORMATIONWhen you run a macro, some of the functions in Microsoft Excel are not completed until after a specified wait state. In the example above, Microsoft Excel will not recognize that the toolbar is open until the macro that creates or activates the chart window is returned.
REFERENCES"Function Reference," pages 285-286, 305-306, 398
|
Additional query words: 4.00 4.00a XL4 XL5
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |