ID: Q119657
5.00 WINDOWS kbprg
The information in this article applies to:
In Microsoft Excel version 5.0, if you use the Set Print Titles command (with Microsoft Excel 4.0 menus displayed) to set a print title while the macro recorder is running, one of the following occurs:
-or-
-or-
If you choose Set Print Titles from the Options menu with the Microsoft Excel 4.0 menus displayed, while the macro recorder is running, a command similar to the following is recorded:
ExecuteExcel4Macro "SET.PRINT.TITLES(Rows("1:1"),Columns("C:C"))"
You receive a syntax error when you run this procedure.
If you select a row or column on the worksheet before you choose Set Print Titles, and you only enter data in the Title For Columns box, an hourglass pointer appears and Microsoft Excel stops responding when you choose OK in the Set Print Titles dialog box.
If you only enter data in the Title For Rows box, you receive a GP fault when you choose OK in the Set Print Titles dialog box.
Note that these behaviors do not occur when you record the macro using the Microsoft Excel 4.0 Macro language.
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.
To avoid the behaviors described above, use the following Visual Basic procedure to set print titles on the active worksheet:
Sub Set_Print()
With ActiveSheet.PageSetup
' Replace $1:$1 with the desired range
.PrintTitleRows = "$1:$1"
' Replace $A:$A with the desired range
.PrintTitleColumns = "$A:$A"
End With
End Sub
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in a later version of Microsoft Excel.
For more information about Printing Titles On Multiple Pages, choose the Search button in Help and type:
titles
KBCategory: kbprg
KBSubcategory:
Additional reference words: 5.00 err msg gpf hang
Version : 5.00
Platform : WINDOWS
Last Reviewed: September 14, 1996