Closed Thread
Results 1 to 4 of 4

Need help debugging 1004 error in Excel 97

  1. #1
    The Fold
    Guest

    Need help debugging 1004 error in Excel 97

    Hi,

    I've recently setup a new PC to run some company reports. This is a
    process I've done numerous times in the past, but for some reason,
    when I press the macro shortcut (Ctrl+R) to run any report, it gets as
    far as the page layout macro and then comes back with an error like

    Runtime error 1004

    Unable to set PrintTitleRows property of the PageSetup class

    and it does this for every row of code that uses that class.

    Here's a sample of code:

    With ActiveSheet.PageSetup
    .PrintTitleRows = "$1:$1"
    .PrintTitleColumns = ""
    End With
    ActiveSheet.PageSetup.PrintArea = ""
    With ActiveSheet.PageSetup
    .LeftHeader = "&""Arial,Bold""Handheld Concession Sales"
    .CenterHeader = ""
    .RightHeader = "&""Arial,Bold""&D"
    .LeftFooter = "&""Arial,Bold""&9&F / &A"
    .CenterFooter = ""
    .RightFooter = "&""Arial,Bold""&9&P of &N"
    .LeftMargin = Application.InchesToPoints(0.748031496062992)
    .RightMargin = Application.InchesToPoints(0.748031496062992)
    .TopMargin = Application.InchesToPoints(0.984251968503937)
    .BottomMargin = Application.InchesToPoints(0.984251968503937)
    .HeaderMargin = Application.InchesToPoints(0.511811023622047)
    .FooterMargin = Application.InchesToPoints(0.511811023622047)
    .PrintHeadings = False
    .PrintGridlines = False
    .PrintComments = xlPrintNoComments
    .PrintQuality = 600
    .CenterHorizontally = False
    .CenterVertically = False
    .Orientation = xlPortrait
    .Draft = False
    .PaperSize = xlPaperA4
    .FirstPageNumber = xlAutomatic
    .Order = xlDownThenOver
    .BlackAndWhite = False
    .Zoom = False
    .FitToPagesWide = 1
    .FitToPagesTall = False
    End With
    Range("A1").Select

    Any ideas? I'm pretty desperate as I need these reports to run this
    weekend.

    Thanks
    --
    Stuart


  2. #2
    Tom Ogilvy
    Guest

    Re: Need help debugging 1004 error in Excel 97

    Do you have a printer/print driver installed on that computer. You must
    have at least a print driver installed to use page setup.

    --
    Regards,
    Tom Ogilvy

    "The Fold" <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    >
    > I've recently setup a new PC to run some company reports. This is a
    > process I've done numerous times in the past, but for some reason,
    > when I press the macro shortcut (Ctrl+R) to run any report, it gets as
    > far as the page layout macro and then comes back with an error like
    >
    > Runtime error 1004
    >
    > Unable to set PrintTitleRows property of the PageSetup class
    >
    > and it does this for every row of code that uses that class.
    >
    > Here's a sample of code:
    >
    > With ActiveSheet.PageSetup
    > .PrintTitleRows = "$1:$1"
    > .PrintTitleColumns = ""
    > End With
    > ActiveSheet.PageSetup.PrintArea = ""
    > With ActiveSheet.PageSetup
    > .LeftHeader = "&""Arial,Bold""Handheld Concession Sales"
    > .CenterHeader = ""
    > .RightHeader = "&""Arial,Bold""&D"
    > .LeftFooter = "&""Arial,Bold""&9&F / &A"
    > .CenterFooter = ""
    > .RightFooter = "&""Arial,Bold""&9&P of &N"
    > .LeftMargin = Application.InchesToPoints(0.748031496062992)
    > .RightMargin = Application.InchesToPoints(0.748031496062992)
    > .TopMargin = Application.InchesToPoints(0.984251968503937)
    > .BottomMargin = Application.InchesToPoints(0.984251968503937)
    > .HeaderMargin = Application.InchesToPoints(0.511811023622047)
    > .FooterMargin = Application.InchesToPoints(0.511811023622047)
    > .PrintHeadings = False
    > .PrintGridlines = False
    > .PrintComments = xlPrintNoComments
    > .PrintQuality = 600
    > .CenterHorizontally = False
    > .CenterVertically = False
    > .Orientation = xlPortrait
    > .Draft = False
    > .PaperSize = xlPaperA4
    > .FirstPageNumber = xlAutomatic
    > .Order = xlDownThenOver
    > .BlackAndWhite = False
    > .Zoom = False
    > .FitToPagesWide = 1
    > .FitToPagesTall = False
    > End With
    > Range("A1").Select
    >
    > Any ideas? I'm pretty desperate as I need these reports to run this
    > weekend.
    >
    > Thanks
    > --
    > Stuart
    >




  3. #3
    The Fold
    Guest

    Re: Need help debugging 1004 error in Excel 97

    On Thu, 20 Oct 2005 08:37:56 -0400, "Tom Ogilvy" <[email protected]>
    wrote:

    >Do you have a printer/print driver installed on that computer. You must
    >have at least a print driver installed to use page setup.


    Ah, that did the trick!

    Thanks a lot....shame google didn't have anything on this one! (I
    guess it will now)

    --
    Stuart


  4. #4

    Re: Need help debugging 1004 error in Excel 97

    Thanks to both of you for posting and answering... this timely post
    just saved me today.


Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1