title: Set Fit to Visible in Pdf from excel vba
body: <p>I am trying to export excel worksheets into pdf. Is there any way by which I can set the pdf property to <code>fit to visible</code> using VBA.
  Thanks</p>
  
  <p>Below is the code snippet which I am using </p>
  
  <pre><code>With wksSalesAndQuotaScoreCard
          '.PageSetup.LeftMargin=Application.InchesToPoints(0.7)
          .PageSetup.LeftMargin = Application.InchesToPoints(0.7)
          .PageSetup.RightMargin = Application.InchesToPoints(0.7)
          .PageSetup.TopMargin = Application.InchesToPoints(0.75)
          .PageSetup.BottomMargin = Application.InchesToPoints(0.75)
          .PageSetup.HeaderMargin = Application.InchesToPoints(0.3)
  
          .PageSetup.Orientation = xlLandscape
          .PageSetup.PrintTitleRows = "_SalesandQuotaScoreCardView"
          .PageSetup.CenterHorizontally = True
          .PageSetup.Order = xlDownThenOver
          .PageSetup.FitToPagesWide = 1
          ''.PageSetup.Zoom = 50
          Set rngSalesAndQuotaView = Range(.Shapes("_SalesandQuotaViewFrame").TopLeftCell.Offset(0, -1), .Shapes("_SalesandQuotaViewFrame").BottomRightCell.Offset(1, 0))
          rngSalesAndQuotaView.Select
      End With
  
      wksScoreCardPayoutView.Select
      wksSalesAndQuotaScoreCard.Select False
      Selection.ExportAsFixedFormat xlTypePDF, IncludeDocProperties:=True, openafterpublish:=True
      wksCustomizeScoreCard.Activate
  </code></pre>