+ Reply to Thread
Results 1 to 4 of 4

Macro to setup page is not working correclty

  1. #1
    Forum Contributor
    Join Date
    01-28-2008
    MS-Off Ver
    Excel 365
    Posts
    157

    Macro to setup page is not working correclty

    I recorded a macro to setup the page for printing with the:
    file name as the center header
    sheet name as the right header
    row and column headings printed (the column letters and the row numbers)
    gridlines shown
    orientation landscape.
    The code does not work correctly when I re-run it. It produces “&R” as the center header and DOES NOT print the comments in place. Oddly, when I delete the following lines, it does work:
    Application.PrintCommunication = False
    Application.PrintCommunication = True

    Any ideas why? The recorded code (after removing extraneous lines) is below.
    Thank you.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,422

    Re: Macro to setup page is not working correclty

    What version of Excel are you using. Application.PrintCommunication is new in Excel 2010. No idea what it would do in any other version.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    01-28-2008
    MS-Off Ver
    Excel 365
    Posts
    157

    Re: Macro to setup page is not working correclty

    I am using Excel 2010. The code I provided is an excerpt from recorded code. (The entire recorded code does not work, either)

  4. #4
    Registered User
    Join Date
    05-29-2012
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Macro to setup page is not working correclty

    I can't answer your question, only share in the frustration. However I did come across the below post which provides some additional background. I have personally experienced all of the 'symptoms' mentioned...

    http://www.edugeek.net/blogs/pico/75...mmunicate.html

+ Reply to 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