In this post, you’ll learn about the error message “DiscontiguousRangeNotSupported – The request for the range does not refer to a contiguous range. Excel Services supports contiguous ranges only.” 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
DiscontiguousRangeNotSupported – The request for the range does not refer to a contiguous range. Excel Services supports contiguous ranges only.
Reason for the Error
The caller supplied a noncontiguous range when trying to set or get a range of cells. Excel Services does not support noncontiguous ranges. It only supports contiguous ranges.
Solution
Enter a contiguous range such as “A1:B7” or “A1” or “MyTable[#Data]” instead of a noncontiguous range such as “A1:B7, B12” or “A1,A3”.