@jamieMacabacus We updated the latest cells cloud version 25.4.0 and added the checkexternalreference and checkformulaerrors API to meet this function.
The sample code to check whether an external workbook or worksheet is referenced is as follows:
var url = BuildUrl(string.Format("checkexternalreference"));
string bodyParam = null;
Dictionary<string, string> headParams = null;
Dictionary<string, object> formParams = null;
DTO.Options.CheckExternalReferenceOptions checkExternalReferenceOptions = new DTO.Options.CheckExternalReferenceOptions();
checkExternalReferenceOptions.FileInfo = GetFileInfo("BookFormula.xlsx");
bodyParam = JsonConvert.SerializeObject(checkExternalReferenceOptions);
var response = ApiInvoker.InvokeApiAsync<DTO.Response.CheckedExternalReferenceResponse>(url, "POST", bodyParam, headParams, formParams).Result;
Assert.IsNotNull(response);
DownloadObject(response, "BookFormula_ExternalReference.json");
The sample code for checking formula errors is as follows (different levels correspond to different parameter settings):
This is to check the formula errors of the entire file
var url = BuildUrl(string.Format("checkformulaerrors"));
string bodyParam = null;
Dictionary<string, string> headParams = null;
Dictionary<string, object> formParams = null;
DTO.Options.CheckFormulaErrorOptions checkFormulaErrorOptions = new DTO.Options.CheckFormulaErrorOptions();
checkFormulaErrorOptions.FileInfo = GetFileInfo("FormulaError.xlsx");
bodyParam = JsonConvert.SerializeObject(checkFormulaErrorOptions);
var response = ApiInvoker.InvokeApiAsync<DTO.Response.CheckedFormulaErrorsResponse>(url, "POST", bodyParam, headParams, formParams).Result;
Assert.IsNotNull(response);
DownloadObject(response, "FormulaError.json");
Check the formula errors of a certain worksheet:
var url = BuildUrl(string.Format("checkformulaerrors"));
string bodyParam = null;
Dictionary<string, string> headParams = null;
Dictionary<string, object> formParams = null;
DTO.Options.CheckFormulaErrorOptions checkFormulaErrorOptions = new DTO.Options.CheckFormulaErrorOptions();
checkFormulaErrorOptions.FileInfo = GetFileInfo("FormulaError.xlsx");
checkFormulaErrorOptions.SheetName = "Sheet1";
bodyParam = JsonConvert.SerializeObject(checkFormulaErrorOptions);
var response = ApiInvoker.InvokeApiAsync<DTO.Response.CheckedFormulaErrorsResponse>(url, "POST", bodyParam, headParams, formParams).Result;
Assert.IsNotNull(response);
DownloadObject(response, "FormulaError_worksheet.json");
Check the corresponding formula errors according to name:
var url = BuildUrl(string.Format("checkformulaerrors"));
string bodyParam = null;
Dictionary<string, string> headParams = null;
Dictionary<string, object> formParams = null;
DTO.Options.CheckFormulaErrorOptions checkFormulaErrorOptions = new DTO.Options.CheckFormulaErrorOptions();
checkFormulaErrorOptions.FileInfo = GetFileInfo("BookFormula.xlsx");
checkFormulaErrorOptions.Names = new List<string> { "Bon"};
bodyParam = JsonConvert.SerializeObject(checkFormulaErrorOptions);
var response = ApiInvoker.InvokeApiAsync<DTO.Response.CheckedFormulaErrorsResponse>(url, "POST", bodyParam, headParams, formParams).Result;
Assert.IsNotNull(response);
DownloadObject(response, "BookFormula_name.json");
Check the corresponding formula errors according to chart:
var url = BuildUrl(string.Format("checkformulaerrors"));
string bodyParam = null;
Dictionary<string, string> headParams = null;
Dictionary<string, object> formParams = null;
DTO.Options.CheckFormulaErrorOptions checkFormulaErrorOptions = new DTO.Options.CheckFormulaErrorOptions();
checkFormulaErrorOptions.FileInfo = GetFileInfo("BookFormula.xlsx");
checkFormulaErrorOptions.ChartIndex = 0;
bodyParam = JsonConvert.SerializeObject(checkFormulaErrorOptions);
var response = ApiInvoker.InvokeApiAsync<DTO.Response.CheckedFormulaErrorsResponse>(url, "POST", bodyParam, headParams, formParams).Result;
Assert.IsNotNull(response);
DownloadObject(response, "BookFormula_chart.json");