XL5: GP Fault Setting PageSetup Object Property to NullLast reviewed: September 12, 1996Article ID: Q121268 |
The information in this article applies to:
SYMPTOMSIn Microsoft Excel, if you set the value of one of the PageSetup object header or footer properties, such as the RightFooter property, to Null in a Visual Basic procedure, you receive a general protection (GP) fault.
CAUSEThis problem occurs because the PageSetup object property is expected to be set to a string value, and cannot be set to the Null value. The Null value is a value indicating that a variable contains no valid data. This problem occurs when you set any of the following properties of the PageSetup object to Null:
RightHeader CenterHeader LeftHeader RightFooter CenterFooter LeftFooter WORKAROUNDTo avoid receiving a GP fault when you set the value of the PageSetup property, do not use the Null value. Instead, to clear the information in the header or footer on the worksheet, set the header or footer property of the PageSetup object to the value "". For example, to clear the information in the right footer on the current worksheet, use the following code:
ActiveSheet.PageSetup.RightFooter = ""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.
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft Excel version 5.0c.
REFERENCESFor more information about Null <definition>, choose the Search button in the Visual Basic Reference and type:
Null |
KBCategory: kbprg
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |