The information in this article applies to:
SYMPTOMSIn Microsoft Excel, when you run a Visual Basic macro that contains the SetBackgroundPicture method, you may receive the following error message even if you did not use the command on a protected worksheet. CAUSEThis error message appears if you apply the SetBackgroundPicture method to a DialogSheet in a Visual Basic macro, regardless of whether the sheet is protected. For example, the error message described above appears when you run a macro that contains the following command:
You can use the SetBackgroundPicture method to set the background graphic
for a worksheet or chart. Because the SetBackgroundPicture method applies
only to the Worksheet object and the Chart object, you should receive an
error message when you use the SetBackgroundPicture method with the
DialogSheet object. However, the error message that should appear in this
case (if the dialog sheet is not protected) is the following:
Note that this error message correctly appears when you use the SetBackgroundPicture method with a Module object. RESOLUTION
To avoid receiving either of the error messages described above when you
use the SetBackgroundPicture method in a Visual Basic macro, use any of the
following methods:
-or-
Method 2: Apply the SetBackgroundPicture method to a Worksheet or Chart
object directly as in the following examples:
-or-
Microsoft provides examples of Visual Basic procedures for illustration
only, without warranty either expressed or implied, including but not
limited to the implied warranties of merchantability and/or fitness for a
particular purpose. This Visual Basic procedure is provided 'as is' and
Microsoft does not guarantee that it can be used in all situations.
Microsoft does not support modifications of this procedure to suit customer
requirements for a particular purpose.
REFERENCESFor more information about using the SetBackgroundPicture method in a Visual Basic macro in Microsoft Excel, click the Index tab in Microsoft Excel Help, and type the following text setbackand then double-click the selected text to go to the "SetBackgroundPicture Method" topic. Additional query words:
Keywords : kbcode kbprg |
Last Reviewed: October 25, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |