title: Save copies as .PDF & .xlsx
body: <p>I'm trying to save copies of the workbook but don't know how to set the file type when saving, this code makes the files but they're corrupt and cannot be opened.</p>
  
  <pre><code>Sub Saves1()
  
  'Store Answers
  Dim SavePdfAnswer As String
  Dim SaveXlsxAnswer As String
  SavePdfAnswer = VBA_CS.Range("C2")
  SaveXlsxAnswer = VBA_CS.Range("C3")
  
  'Store File Path And Names
  PdfFilePath = VBA_CS.Range("M2") &amp; "\" &amp; ActiveSheet.Range("F9") &amp; ".pdf" 'File path for pdf file
  ExcelFilePath = VBA_CS.Range("M2") &amp; "\" &amp; ActiveSheet.Range("F9") &amp; ".xlsx" 'File path for excel xlsx file
  
  'Save as pdf
  If SavePdfAnswer = "Yes" Then
    ActiveWorkbook.SaveCopyAs PdfFilePath
  End If
  
  'Save as excel xlsx
  If SaveXlsxAnswer = "Yes" Then
    ActiveWorkbook.SaveCopyAs ExcelFilePath
  End If
  
  End Sub
  </code></pre>