Excel.run error in IE 11
I'm creating an Excel Addin using the Office Add-in generator, by @OfficeDev! I'm running "yo office" and create with this options: Office Add-in Task Pane project JavaScript
A project with a default template is created ok.
Next, as an admin, in a powershell console I run: npm run start:web The server starts and I test my Exce Addin in Excel Online in Internet Explorer 11.239.18362.0
When I run the addin, a taskpane is open and I click run nothing happen. The code running is:
`export async function run() { try { await Excel.run(async context => { /** * Insert your Excel code here */ const range = context.workbook.getSelectedRange();
// Read the range address
range.load("address");
// Update the fill color
range.format.fill.color = "yellow";
await context.sync();
console.log(`The range address was ${range.address}.`);
});
} catch (error) { console.error(error); }`
In Debug console I have seen thar Excel object is undefined and I receive this error message:
TypeError: Unable to get property 'run' of undefined or null reference { [functions]: , proto: { }, description: "Unable to get property 'run' of undefined or null reference", message: "Unable to get property 'run' of undefined or null reference", name: "TypeError", number: -2146823281, stack: "TypeError: Unable to get property 'run' of undefined or null reference at _callee2$ (https://localhost:3000/taskpane.js:9908:13) at tryCatch (https://localhost:3000/polyfill.js:204:7) at invoke (https://localhost:3000/polyfill.js:430:9) at prototype[method] (https://localhost:3000/polyfill.js:256:9) at asyncGeneratorStep (https://localhost:3000/taskpane.js:9879:84) at _next (https://localhost:3000/taskpane.js:9881:194) at Anonymous function (https://localhost:3000/taskpane.js:9881:364) at Promise (https://localhost:3000/polyfill.js:7948:7) at Anonymous function (https://localhost:3000/taskpane.js:9881:90) at run (https://localhost:3000/taskpane.js:9895:3)" }
Expected Behavior
A selected range of cells is coloured yellow. This works fine in Chrome and Edge not depending of its version.
Current Behavior
Nothing happens. I have seen Excel object is not created
Steps to Reproduce, or Live Example
Only running on IE 11 a default project created as I described in the beginning.
Context
It's mandatory that addins run on IE 11 to publish in AppSource.
Your Environment
- Platform [PC desktop, Mac, iOS, Office Online]: Office Online
- Host [Excel, Word, PowerPoint, etc.]:
- Office version number: Office Online.
- Operating System: Windows 10 1903. Latest updates applied.
- Browser (if using Office Online): Internet Explorer 11.239.18362.0
Useful logs
- [x] Console errors TypeError: Unable to get property 'run' of undefined or null reference { [functions]: , proto: { }, description: "Unable to get property 'run' of undefined or null reference", message: "Unable to get property 'run' of undefined or null reference", name: "TypeError", number: -2146823281, stack: "TypeError: Unable to get property 'run' of undefined or null reference at _callee2$ (https://localhost:3000/taskpane.js:9908:13) at tryCatch (https://localhost:3000/polyfill.js:204:7) at invoke (https://localhost:3000/polyfill.js:430:9) at prototype[method] (https://localhost:3000/polyfill.js:256:9) at asyncGeneratorStep (https://localhost:3000/taskpane.js:9879:84) at _next (https://localhost:3000/taskpane.js:9881:194) at Anonymous function (https://localhost:3000/taskpane.js:9881:364) at Promise (https://localhost:3000/polyfill.js:7948:7) at Anonymous function (https://localhost:3000/taskpane.js:9881:90) at run (https://localhost:3000/taskpane.js:9895:3)" }
@javierpr71 Thanks for contacting us about this issue. I just tried out your scenario in the latest generator-office release (1.3.0), and didn't run into any problems. Can you please run "npm view generator-office version" and ensure you are running version 1.3.0. If not please update generator-office by running "npm install -g [email protected]"
The result of running your command in my console is
npm view generator-office version
1.3.0
I think this is related to Windows version WIndows 10 Pro 10.0.18362 Build 18362
I can reproduce this issue in this windows version
I'm transferring this issue to the OfficeDev/generator-office repo.
any update ?
I will see if I can repro this issue, but I don't think this should go under the generator-office project. If anything, it seems to be more of an issue with office-js and not a problem with generator-office, which is simply a project generation tool.
-Courtney
I just tried the following scenario out with no problems:
- Created Office-Addin-Taskpane JavaScript Excel project with generator-office
- CD to project and run "npm run start:web"
- Browse to OneDrive in IE11, create an Excel workbook and open the workbook
- Upload the project manifest via Insert --> Add-ins --> Manage My Add-ins
- Once the add-in is registered, open the add-in taskpane and click "Run"
Everything works fine for me
I am curious, does that add-in project work in Edge browser? Is this an IE-only issue?
Thanks,
Courtney
work fine inside Office.onReady
Is this still a problem? IE11 webview is aging out at this point.