Code is below - it provides a blank Word document. No error, nothing:
Sub printCoverLetter()
Dim wb As Workbook
Dim filePath As String
Dim sheetsToPrintArray()
Dim sheetCount As Integer
Dim objWord As Object
Dim objDoc As Object
Dim objTitle As String
Dim FileCopyPath As String
Set wb = ThisWorkbook
'change this title to something more relative if needed
objTitle = "Configuration Guide"
filePath = wb.Path
FileCopyPath = filePath & "\" & objTitle & ".docx"
'always adjust cover letter contents first, just to make sure
'this is being called everytime the sheet is activated within the sheet code, but just as a fail safe
Sheet2.Range("$K$53:$K$63").AutoFilter Field:=1, Criteria1:="1"
'always print
sheetCount = 1
ReDim Preserve sheetsToPrintArray(sheetCount)
sheetsToPrintArray(0) = Sheet2.Index
sheetsToPrintArray(1) = Sheet4.Index
'if medicaid
If Sheet1.Cells(15, "D") = "YES" Then
sheetCount = sheetCount + 1
ReDim Preserve sheetsToPrintArray(sheetCount)
sheetsToPrintArray(sheetCount) = Sheet6.Index
End If
'if medicare
If Sheet1.Cells(16, "D") = "YES" Then
sheetCount = sheetCount + 1
ReDim Preserve sheetsToPrintArray(sheetCount)
sheetsToPrintArray(sheetCount) = Sheet7.Index
End If
'if ACPS
If Sheet1.Cells(17, "D") = "YES" Then
sheetCount = sheetCount + 1
ReDim Preserve sheetsToPrintArray(sheetCount)
sheetsToPrintArray(sheetCount) = Sheet8.Index
End If
hideShow True, sheetsToPrintArray
Sheets(sheetsToPrintArray).Select
Set objWord = CreateObject("word.application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add
objDoc.SaveAs2 Filename:=FileCopyPath
hideShow False, sheetsToPrintArray
'to remove the multi sheet selection
Sheet1.Select
End Sub
Function hideShow(isVisible As Boolean, sheetsToPrintArray())
For i = 0 To UBound(sheetsToPrintArray)
Sheets(sheetsToPrintArray(i)).Visible = isVisible
Next i
End Function