Sheets.PrintOut in VBA using Excel for the Mac 2016

Anonymous
2016-05-17T17:20:33+00:00

Hi gang,

   I'm trying to use a VBA Macro within Excel for the Mac 2016 (Version 15.22).

   I *think* that VBA commands are documented at:

     https://msdn.microsoft.com/en-us/library/office/ff838253.aspx

   But perhaps this is only for the Windows product ????

      (if it's only for the windows product and not for mac, could someone tell me the correct documentation to use??)

  At any rate, I'm trying to print out (on a printer) just one specific page on the worksheet.  

  Under Excel for windows this VBA line works fine:

Worksheets. ("sheet1").PrintOut From:=2, To:=3

    However, under VBA on my Mac, all sheets are printed out.  The FROM and TO fields are ignored.

    All other parameters (like  "Preview"  and  "Collate" etc) are also ignored.

 Any suggestions as to what I may be doing wrong?  Or does Mac VBA not allow these parameters?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2016-05-18T14:53:36+00:00

    Hey,

    I think this is for Windows as you have found out yourself, however, I am not able to suggest changes for use with Mac.

    I hope somebody comes our way soon and helps.

    0 comments No comments
  2. Jim G 134K Reputation points MVP Volunteer Moderator
    2016-05-20T18:31:49+00:00

    Hi

    Your syntax is off just a bit. There should be no dot or space after worksheets. This is the correct syntax (at least Excel did not complain about it):

    Worksheets("Sheet1").PrintOut From:=2, To:=3

    That said, I was able to reproduce the problem using Excel version 15.22. All 3 pages printed for me, as well.

    Please advise Microsoft of the problem by clicking the Smile button in Excel and use the Send a Frown feature.

    Thanks.

    2 people found this answer helpful.
    0 comments No comments