+ Reply to Thread
Results 1 to 4 of 4

New "Unable to set the CentreHeader property of the PageSetup class" error

  1. #1
    Registered User
    Join Date
    08-10-2020
    Location
    Chorley, Lancashire
    MS-Off Ver
    365
    Posts
    6

    New "Unable to set the CentreHeader property of the PageSetup class" error

    I've had this piece of code in my Personal macro file for years and I've never had any issues with it:


    Sub Header_Footer()

    ' Set centre header to display worksheet name and centre footer to
    'display network file path and workbookname

    With ActiveSheet.PageSetup
    .CenterHeader = "Worksheet name: &A"
    .CenterFooter = "Filepath: &Z&F"

    End With

    ActiveSheet.PrintPreview

    End Sub

    I've just tried to run it against a workbook someone else sent to me, and I got the error message in the title.

    When I debug, it highlights the:

    .CenterHeader = "Worksheet name: &A"

    line

    Any thoughts what could be causing this?

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,908

    Re: New "Unable to set the CentreHeader property of the PageSetup class" error

    Do you have a default printer set?
    Rory

  3. #3
    Registered User
    Join Date
    08-10-2020
    Location
    Chorley, Lancashire
    MS-Off Ver
    365
    Posts
    6

    Re: New "Unable to set the CentreHeader property of the PageSetup class" error

    Yes, but it's a network print queue type thing (Follow-You on a network)

    Could that be the problem??

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,908

    Re: New "Unable to set the CentreHeader property of the PageSetup class" error

    That should be fine as long as it’s available. Can you actually print to it currently?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Run Time Error "1004": Unable to get the Insert property of the picture class
    By rmeckm2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-01-2015, 01:46 PM
  2. Getting "Unable to set CurrentPage property of PivotField class" error
    By jsweez24 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-06-2015, 03:03 PM
  3. Error 1004 - "Unable to get the CountIf property of the WorksheetFunction class"
    By kknb0800 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-27-2015, 12:41 AM
  4. Error: "Unable to get the interior property of the range class."
    By wunderfisch in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-18-2013, 03:18 PM
  5. Run-time error 1004; "Unable to set the Hidden property of the Range Class"
    By danimal_time in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-22-2012, 01:06 PM
  6. Error "Unable to set the Visible property of the PivotItem class"
    By Greg M in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-04-2010, 12:51 PM
  7. "Unable to set FormulaArry property of the range class" - Error
    By drgogo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-17-2010, 02:19 PM

Tags for this Thread

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