Skip to content

Commit 3879073

Browse files
thechriskentLinda Caputo
authored andcommitted
Fixed broken link (SharePoint#2545)
* Fixed broken link * Fixed broken link Also fixed NOTE identifier * Fixed See also * Edit pass to fix code lang and See also
1 parent 0042633 commit 3879073

File tree

2 files changed

+85
-160
lines changed

2 files changed

+85
-160
lines changed
Lines changed: 12 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Excel Services Error Codes
2+
title: Excel Services error codes
33
ms.date: 09/25/2017
44
keywords: alerts
55
f1_keywords:
@@ -9,28 +9,17 @@ ms.assetid: ff128d67-f3ac-4a8f-ae8e-1e19e343014e
99
---
1010

1111

12-
# Excel Services Error Codes
12+
# Excel Services error codes
1313

1414
Excel Services generates errors and error messages in the SOAP exception based on errors that occur in Excel Services. The following table shows the errors that are accessible when calls to the Excel Web Services methods throw a SOAP exception.
15-
16-
17-
18-
19-
You use the [SubCode](http://msdn.microsoft.com/library/frlrfSystemWebServicesProtocolsSoapExceptionClassSubCodeTopic.aspx) property of the **SoapException** class to capture the error codes. For more information about using the **SubCode** property to capture error codes, see [How to: Use the SubCode Property to Capture Error Codes](how-to-use-the-subcode-property-to-capture-error-codes.md)
20-
For more information about Excel Services alerts, see [Excel Services Alerts](excel-services-alerts.md).
21-
22-
23-
2415

16+
You use the [SubCode](https://docs.microsoft.com/dotnet/api/system.web.services.protocols.soapexception.subcode?view=netframework-4.7.2) property of the **SoapException** class to capture the error codes. For more information about using the **SubCode** property to capture error codes, see [How to: Use the SubCode Property to Capture Error Codes](how-to-use-the-subcode-property-to-capture-error-codes.md)
17+
For more information about Excel Services alerts, see [Excel Services Alerts](excel-services-alerts.md).
2518

26-
## Error Codes
19+
## Error codes
2720

2821
The following table lists the error codes for Excel Web Services alerts and the associated messages, explanation, and resolutions.
29-
30-
31-
32-
33-
22+
3423
|**Error Code**|**Message**|**Explanation**|**Resolution**|
3524
|:-----|:-----|:-----|:-----|
3625
|ApiInvalidArgument <br/> |Invalid value to argument: {0} <br/> |An invalid value for an argument was passed into the API call. <br/> 0 = name of the argument. Its value is invalid. <br/> |Use a valid value for the argument. <br/> |
@@ -52,38 +41,19 @@ The following table lists the error codes for Excel Web Services alerts and the
5241
|NotMemberOfRole <br/> |Access denied. You do not have permission to perform this action or access this resource. <br/> |The caller does not have permission to access the server. <br/> |Contact your administrator. <br/> |
5342
|ObjectTypeNotSupported <br/> |One or more object types provided are not supported by Excel Services. The operation was rolled back. <br/> |The caller tried to write unsupported object type values into a range. <br/> |Try the operation again using one of the supported object types. <br/> |
5443
|OperationCanceled <br/> |The operation has been canceled. <br/> |The operation that is currently taking place is canceled because the user calls the **CancelRequest** method. <br/> |Call the **CancelRequest** method only if you want to cancel the current operation. <br/> |
55-
|RangeParseError <br/> |Excel Services was unable to parse the range request. <br/> |The range that was passed into a method with the A1 suffix ( **SetCellA1**, **SetRangeA1**, **GetCellA1**, and **GetRangeA1**) could not be parsed. <br/> |Enter a range reference using A1 notation such as "Sheet1!Range("A6:A15")" or a valid structured reference such as "[ShipCity].[#Headers]". <br/> |
44+
|RangeParseError <br/> |Excel Services was unable to parse the range request. <br/> |The range that was passed into a method with the A1 suffix (**SetCellA1**, **SetRangeA1**, **GetCellA1**, and **GetRangeA1**) could not be parsed. <br/> |Enter a range reference using A1 notation such as "Sheet1!Range("A6:A15")" or a valid structured reference such as "[ShipCity].[#Headers]". <br/> |
5645
|RangeRequestAreaExceeded <br/> |The area of the requested range exceeds 1,000,000 cells. <br/> |The requested range exceeds the 1,000,000 cell limit. <br/> |To return ranges that contain more than 1,000,000 cells, use multiple calls. <br/> |
5746
|RetryError <br/> |Excel Services is unable to process the request. <br/> |Excel Services might at times reach a state where its resources are low. When this happens, it might start denying requests. <br/> |Wait a few minutes and try to perform this operation again. <br/> |
5847
|SaveFailed <br/> |An error occurred while saving the file. <br/> |A call to the **GetWorkbook** method failed. <br/> |Try to save the file again. <br/> |
5948
|SetRangeFailure <br/> |The requested operation attempted to overwrite the contents of cells that cannot be edited. <br/> |The caller tried to write values into a range that has protected cells. For example, the cell contains a formula. <br/> |Only empty cells or cells that contain values can be edited by Excel Services. <br/> |
6049
|SheetRangeMismatch <br/> |The sheet provided as the sheet argument is not the same as the sheet specified in the range argument. <br/> |The name of the sheet passed in for a _sheetName_ parameter does not match the sheet ___location specified in the _rangeName_ parameter. <br/> |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"))`. <br/> |
61-
|SpecifiedRangeNotFound <br/> |The requested range does not exist in the sheet. <br/> |The range that was passed into a method with the A1 suffix ( **SetCellA1**, **SetRangeA1**, **GetCellA1**, and **GetRangeA1**) could not be found. <br/> |Make sure the range specified exists in the sheet. <br/> |
50+
|SpecifiedRangeNotFound <br/> |The requested range does not exist in the sheet. <br/> |The range that was passed into a method with the A1 suffix (**SetCellA1**, **SetRangeA1**, **GetCellA1**, and **GetRangeA1**) could not be found. <br/> |Make sure the range specified exists in the sheet. <br/> |
6251
|WorkbookNotSupported <br/> |The file you selected cannot be opened because it contains feature(s) that are not supported by Excel Services. One or more of the following unsupported features were detected in the workbook: <br/> {0} <br/> |The workbook contains unsupported features. <br/> 0 = a \\n separated list of unsupported feature names. <br/> |Make sure the workbook does not contain features that are not supported by Excel Services. <br/> |
6352

6453

6554
## See also
66-
67-
68-
#### Tasks
69-
70-
71-
72-
73-
74-
[How to: Use the SubCode Property to Capture Error Codes](how-to-use-the-subcode-property-to-capture-error-codes.md)
75-
#### Concepts
76-
77-
78-
79-
80-
81-
[Excel Services Alerts](excel-services-alerts.md)
82-
83-
84-
85-
[Excel Services Known Issues and Tips](excel-services-known-issues-and-tips.md)
86-
87-
8855

89-
[Excel Services Best Practices](excel-services-best-practices.md)
56+
- [How to: Use the SubCode Property to Capture Error Codes](how-to-use-the-subcode-property-to-capture-error-codes.md)
57+
- [Excel Services Alerts](excel-services-alerts.md)
58+
- [Excel Services Known Issues and Tips](excel-services-known-issues-and-tips.md)
59+
- [Excel Services Best Practices](excel-services-best-practices.md)

docs/general-development/how-to-use-the-subcode-property-to-capture-error-codes.md

Lines changed: 73 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -12,71 +12,68 @@ ms.assetid: 8ce4d5b2-111b-49e7-9d07-8c2c586221ec
1212
# Use the SubCode property to capture error codes
1313

1414
Excel Services generates errors in the SOAP exception based on errors that occur in Excel Services. To make it easier for the developer to catch specific error conditions, an Excel Calculation Services alert has an associated error code. The Excel Web Services then returns the error using properties from the **SoapException** class.
15-
16-
17-
1815

19-
The following examples show how to capture the error codes using the [SubCode](http://msdn.microsoft.com/library/frlrfSystemWebServicesProtocolsSoapExceptionClassSubCodeTopic.aspx) property (http://msdn.microsoft.com/en-us/library/system.web.services.protocols.soapexception.subcode.aspx) of the **SoapException** class.
16+
The following examples show how to capture the error codes by using the [SubCode](https://docs.microsoft.com/dotnet/api/system.web.services.protocols.soapexception.subcode?view=netframework-4.7.2) property of the **SoapException** class.
2017

21-
[!NOTE]
18+
> [!NOTE]
2219
> To be able to use the **SubCode** property, you must use Microsoft Visual Studio 2005. The **SubCode** property does not exist in earlier versions of Visual Studio.
2320
24-
For a list of error codes, see [Excel Services Error Codes](excel-services-error-codes.md).
25-
### To capture error codes when using SOAP
21+
For a list of error codes, see [Excel Services Error Codes](excel-services-error-codes.md).
2622

23+
### To capture error codes when using SOAP
2724

2825
1. After adding a Web reference to the Excel Web Services, add the following using directive so that you can use the **SoapException** class without having to qualify it with a full namespace:
2926

30-
```cs
31-
32-
using System.Web.Services.Protocols;
33-
```
27+
```cs
3428

29+
using System.Web.Services.Protocols;
30+
```
3531

36-
```VB.net
37-
Imports System.Web.Services.Protocols
38-
```
32+
33+
```vb
34+
Imports System.Web.Services.Protocols
35+
```
3936

4037
2. To capture the Excel Services error codes using the **SubCode** property, you must use the SOAP12 protocol version. After instantiating the Excel Web Services proxy class, set the SOAP protocol version as follows:
4138

42-
```cs
43-
// Instantiate the Web service.
44-
ExcelService xlservice = new ExcelService();
39+
```cs
40+
// Instantiate the Web service.
41+
ExcelService xlservice = new ExcelService();
4542

46-
// Set the SOAP protocol version.
47-
xlservice.SoapVersion = SoapProtocolVersion.Soap12;
48-
```
43+
// Set the SOAP protocol version.
44+
xlservice.SoapVersion = SoapProtocolVersion.Soap12;
45+
```
4946

5047

51-
```VB.net
52-
53-
' Instantiate the Web service.
54-
Dim xlservice As New ExcelService()
48+
```vb
5549

56-
' Set the SOAP protocol version.
57-
xlservice.SoapVersion = SoapProtocolVersion.Soap12
58-
```
50+
' Instantiate the Web service.
51+
Dim xlservice As New ExcelService()
52+
53+
' Set the SOAP protocol version.
54+
xlservice.SoapVersion = SoapProtocolVersion.Soap12
55+
```
5956

6057
3. To catch the error codes using the **SubCode** property, add a SOAP exception catch block to your code, for example:
6158

62-
```cs
63-
64-
catch (SoapException e)
65-
{
66-
Console.WriteLine("SOAP Exception Message: {0}", e.Message);
67-
Console.WriteLine("SOAP Exception Error Code: {0}",
68-
e.SubCode.Code.Name);
69-
}
70-
```
59+
```cs
7160

61+
catch (SoapException e)
62+
{
63+
Console.WriteLine("SOAP Exception Message: {0}", e.Message);
64+
Console.WriteLine("SOAP Exception Error Code: {0}",
65+
e.SubCode.Code.Name);
66+
}
67+
```
7268

73-
```VB.net
74-
75-
Catch e As SoapException
76-
Console.WriteLine("SOAP Exception Message: {0}", e.Message)
77-
Console.WriteLine("SOAP Exception Error Code: {0}", e.SubCode.Code.Name)
78-
End Try
79-
```
69+
70+
```vb
71+
72+
Catch e As SoapException
73+
Console.WriteLine("SOAP Exception Message: {0}", e.Message)
74+
Console.WriteLine("SOAP Exception Error Code: {0}", e.SubCode.Code.Name)
75+
End Try
76+
```
8077

8178

8279
### To capture error codes when using direct linking
@@ -87,49 +84,45 @@ End Try
8784

8885
2. After you add a reference, add the following **using** directive to your code so that you can use the **SoapException** class without having to qualify it with a full namespace:
8986

90-
```cs
91-
92-
using System.Web.Services.Protocols;
93-
```
87+
```cs
9488

89+
using System.Web.Services.Protocols;
90+
```
9591

96-
```VB.net
97-
Imports System.Web.Services.Protocols
98-
```
92+
93+
```vb
94+
Imports System.Web.Services.Protocols
95+
```
9996

10097
3. Unlike using SOAP over HTTP, in the direct linking scenario, you won't need to set the SOAP protocol version.
10198

10299

103100
4. To catch the error codes using the **SubCode** property, add a SOAP exception catch block to your code, for example:
104101

105-
```cs
106-
catch (SoapException e)
107-
{
108-
Console.WriteLine("SOAP Exception Message: {0}", e.Message);
109-
Console.WriteLine("SOAP Exception Error Code: {0}",
110-
e.SubCode.Code.Name);
111-
}
112-
```
102+
```cs
103+
catch (SoapException e)
104+
{
105+
Console.WriteLine("SOAP Exception Message: {0}", e.Message);
106+
Console.WriteLine("SOAP Exception Error Code: {0}",
107+
e.SubCode.Code.Name);
108+
}
109+
```
113110

114111

115-
```VB.net
116-
117-
Catch e As SoapException
118-
Console.WriteLine("SOAP Exception Message: {0}", e.Message)
119-
Console.WriteLine("SOAP Exception Error Code: {0}", e.SubCode.Code.Name)
120-
End Try
121-
```
112+
```vb
113+
114+
Catch e As SoapException
115+
Console.WriteLine("SOAP Exception Message: {0}", e.Message)
116+
Console.WriteLine("SOAP Exception Error Code: {0}", e.SubCode.Code.Name)
117+
End Try
118+
```
122119

123120

124121
## Example
125122

126123
The following program (a console application) uses the **SubCode** property to capture the error codes. The program takes different actions based on the error code that is caught. You can, for example, intentionally pass in a nonexistent sheet name to trigger a SOAP exception. In this case, the following SOAP exception message is returned:
127-
128-
129-
130124

131125
```
132-
133126
The sheet that was requested could not be found. Please try a different one.
134127
```
135128

@@ -257,8 +250,9 @@ namespace SubCodeExample
257250

258251
```
259252

253+
<br/>
260254

261-
```VB.net
255+
```vb
262256

263257
Imports System
264258
Imports System.Collections.Generic
@@ -344,55 +338,16 @@ End Namespace
344338
## Robust programming
345339

346340
Make sure that you add a Web reference to an Excel Web Services site that you have access to. Change the `using SubCodeExample;` statement to point to the Web service site that you are referencing.
347-
348-
349-
341+
350342
In addition, make changes to the workbook path, sheet name, and so on, as appropriate.
351-
352-
353-
354343

355344
## See also
356345

357-
358-
#### Tasks
359-
360-
361-
362-
363-
364-
[How to: Catch Exceptions](how-to-catch-exceptions.md)
365-
366-
367-
368-
[How to: Trust a Location](how-to-trust-a-___location.md)
369-
370-
371-
372-
[How to: Save from Excel Client to the Server](how-to-save-from-excel-client-to-the-server.md)
373-
#### Concepts
374-
375-
376-
377-
378-
379-
[Accessing the SOAP API](accessing-the-soap-api.md)
380-
381-
382-
383-
[Excel Services Alerts](excel-services-alerts.md)
384-
385-
386-
387-
[Excel Services Known Issues and Tips](excel-services-known-issues-and-tips.md)
388-
389-
390-
391-
[Loop-Back SOAP Calls and Direct Linking](loop-back-soap-calls-and-direct-linking.md)
392-
#### Other resources
393-
394-
395-
396-
397-
398-
[Walkthrough: Developing a Custom Application Using Excel Web Services](walkthrough-developing-a-custom-application-using-excel-web-services.md)
346+
- [How to: Catch Exceptions](how-to-catch-exceptions.md)
347+
- [How to: Trust a Location](how-to-trust-a-___location.md)
348+
- [How to: Save from Excel Client to the Server](how-to-save-from-excel-client-to-the-server.md)
349+
- [Accessing the SOAP API](accessing-the-soap-api.md)
350+
- [Excel Services Alerts](excel-services-alerts.md)
351+
- [Excel Services Known Issues and Tips](excel-services-known-issues-and-tips.md)
352+
- [Loop-Back SOAP Calls and Direct Linking](loop-back-soap-calls-and-direct-linking.md)
353+
- [Walkthrough: Developing a Custom Application Using Excel Web Services](walkthrough-developing-a-custom-application-using-excel-web-services.md)

0 commit comments

Comments
 (0)