The error is in the line below:
sheetCount = result
The error message is also right (Type mismatch), as the result is an array and sheetCount is an integer.
Type mismatch
result
sheetCount
The error line should be changed to below:
sheetNames = result