shivharakh
Aug 01, 2023Copper Contributor
Status:
New
RichApi.Error: There was an internal error while processing the request.
I have developed an Excel Javascript plugin using the React framework.
The add-in workflow is simple.
- Request data from Ui using APIs
- Passing entities' column names and authorized API keys
- Start writing data into an active Excel sheet by pulling the button.
Steps to reproduce
1. Open the Excel file
2. Select the criteria for pulling data
3. Open another Excel file
4. Again Select the criteria for pulling data
5. Pull the data at a time with a button click.
Problem :
The table got printed only in one Excel sheet only. In another Excel sheet, I got the below error.
RichApi.Error: There was an internal error while processing the request.
at new n (excel-win32-16.01.js:25:259407)
at i.processRequestExecutorResponseMessage (excel-win32-16.01.js:25:323853)
at excel-win32-16.01.js:25:321916
Below is the sample code
try {
var i = 0;
// these data are coming from APIs
var allCompanies = [12, 32, 33, 43, 45, 66, 12, 32, 10, 12, 21, 90];
allCompanies.forEach(async _company => {
// calling APIs for each _docs and writing data for that companies
await fetchData(_company).then(async (responseRows) => {
await Excel.run(async (context) => {
let sheet = context.workbook.worksheets.getActiveWorksheet();
sheet.load(["name"]);
await context.sync();
for (let i = 0; i < responseRows.length; i++) {
// data operations into Exel sheet
// creating table, table header, applying Css
// writting value to each cells
}
sheet.getUsedRange().format.autofitColumns();
sheet.getUsedRange().format.autofitRows();
await context.sync();
});
});
});
} catch (error) {
console.log("error on appending data into excel " + error);
}
I don't know why I'm getting errors.
Can anyone have any idea about this error?
Can anyone have any idea about this error?
No CommentsBe the first to comment