PUB2002: Run-Time Error 9 When You Programmatically Change Color Schemes (289023)
The information in this article applies to:
This article was previously published under Q289023 SYMPTOMS
in a Microsoft Publisher publication, when you run a Microsoft Visual Basic for Applications macro that changes the color scheme of the publication, the following (or similar) error message may appear:
Run-time error '9'
Subscript out of range
This error message appears when you attempt to use the following color schemes that are listed in the Publisher Color Schemes object model:
- Celebration
- Cherry
- Ocean
- Orange
- Peach
- Purple
NOTE: The color schemes on this list do not appear in the Apply a color scheme list in the Color Schemes pane.
The error message also appears when you attempt to use the Bluebird color scheme, which does appear in the Apply a color scheme list.
NOTE: There are four color schemes that appear in the Apply a color scheme list that are not listed in the Publisher Object Model:
Eggplant
Grove
Harbor
Tuscany
The error message does not appear if you use these color schemes in a macro.
CAUSE
This behavior occurs for the following reasons:
- The Celebration, Cherry, Ocean, Orange, Peach, and Purple color schemes exist only in the Japanese version of Publisher. The Object Model libraries are not localized ,so that all of the color schemes that can be used in Publisher are listed in the Object Model, even when they are not provided for a specific locality.
- The Bluebird color scheme is the default Publisher color scheme. This color scheme is not expected to be selected programmatically and is not included in the Object Model, and cannot be specifically called by Visual Basic for Applications.
- The Eggplant, Grove, Harbor, and Tuscany color schemes were added to Publisher after the Object Model was created so they do not appear in the Object Model library; however, like custom color schemes that you create, these color schemes can be selected programmatically.
RESOLUTION
To resolve this behavior, programmatically select only the color schemes that appear in the Apply a color scheme list in the Color Schemes pane.
If you select a color scheme on the Apply a color scheme list other than Bluebird, and you want to change back to the Bluebird color scheme, click Bluebird on the Apply a color scheme list rather than attempting to change the color scheme programmatically.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 11/5/2003 |
---|
Keywords: | kbbug kbpending KB289023 |
---|
|