In this post, you’ll learn about the error message “SheetRangeMismatch – The sheet provided as the sheet argument is not the same as the sheet specified in the range argument.” that you usually receive when working eith the Excel Services in SharePoint.
When working with SharePoint Excel Services, there are error codes that are generated in the SOAP exception when the errors occur in the Excel Services. You can use the SubCode property that is available in the SoapException class to identity these error codes and troubleshoot the issue.
Error Message
SheetRangeMismatch – The sheet provided as the sheet argument is not the same as the sheet specified in the range argument.
Reason for the Error
The name of the sheet passed in for a sheetName parameter does not match the sheet location specified in the rangeName parameter.
Solution
When specifying a sheet in both the range and sheet arguments, ensure that the sheet names are the same. For example, Calculate(Sheet1, Sheet1!Range(“A1”)).