title: When saving a copy of a workbook, sheet becomes unhidden
body: <p>I am saving a copy of a workbook as a non-macro enabled workbook with some of the backend sheets hidden. I prefer to keep the backend sheets in the workbook for record keeping. </p>
  
  <p>The first sheet in the workbook is one of the hidden sheets, here named "Sheet1". For some reason, when I open a copy of the newly saved workbook, it's not hidden anymore. I can even see that it was correctly hidden after the VBA saves if I add a breakpoint between saving and closing.</p>
  
  <p>Any help with figuring this out is appreciated!</p>
  
  <pre><code>Sub MyVBA()
  
          Dim ws As Worksheet
          Dim wsName As Variant
  
          'The string in quotes is what name the report should save and email as.
          wsName = "My Workbook - "
  
              ActiveWorkbook.Save
  
              'Saves a master copy
              'Name the first and last of the backend sheets you want to hide before saving a master. It will hide everything in between.
                  For i = Sheets("Sheet1").Index To Sheets("Sheet5").Index
                      Sheets(i).Select Replace:=False
                  Next i
                  ActiveWindow.SelectedSheets.Visible = False
  
              ThisWorkbook.Sheets.Copy
              With ActiveWorkbook
                  .SaveAs ThisWorkbook.Path &amp; "\" &amp; wsName &amp; Format(Date, "yyyy-mm-dd") &amp; ".xlsx", FileFormat:=51
                  .Close
              End With
  
      End Sub
  </code></pre>
  
  <p><strong><em>EDIT:</em></strong></p>
  
  <p>I tested it out with explicit references, and I'm getting the same issue.</p>
  
  <pre><code>            For i = Sheets("Data").Index To Sheets("Key").Index
                  Sheets(i).Select Replace:=False
              Next i
              Workbooks("Test.xlsm").Windows(1).SelectedSheets.Visible = False
  
          Workbooks("Test.xlsm").Sheets.Copy
          With ActiveWorkbook
              .SaveAs Workbooks("Test.xlsm").Path &amp; "\" &amp; wsName &amp; Format(Date, "yyyy-mm-dd") &amp; ".xlsx", FileFormat:=51
              .Close
          End With
  </code></pre>