I haven't looked at all the code, but the query should be something like this for it to work:
Private Sub cmdOutputXLSX_Click()
Dim strSQL As String
Dim strQry As String
Dim myPath As String
Dim sFileName As String
'Don't know what strQry is about, but hopefully fixing for...