XL: Hiding Chart Toolbar with an XLM Macro FailsID: Q99519
|
In 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.
Whenever 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()
Create_Chart
=NEW("Chart")
=ON.TIME(NOW()+"00:00:01","Hide_Toolbar")
=RETURN()
Hide_Toolbar
=SHOW.TOOLBAR(4,FALSE)
=RETURN()
This is by design of the versions of Microsoft Excel listed at the beginning of this article.
When 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.
"Function Reference," pages 285-286, 305-306, 398
Additional query words: 4.00a XL4 XL5
Keywords :
Version : WINDOWS:4.0,4.0a,5.0; MACINTOSH:4.0,5.0
Platform : MACINTOSH WINDOWS
Issue type : kbprb
Last Reviewed: April 5, 1999