Comments (19)
Hi @forlemon & @rmrodrigues, we found the problem is that Office Online fails to parse a version number that consists of less than four parts (like 2.12). The version number in the add-in manifest should be in a format like 2.12.0.0
We have checked-in a fix for this but it needs a few weeks to deploy. In the mean time, you can just change the version number in the add-in manifest to a supported format, and it should fix the problem.
from office-js.
Made a simple Test.
This:
$scope.test = function () {
Excel.run(function (context) {
var ws = context.workbook.worksheets.getActiveWorksheet();
var cel = ws.getCell(1, 1);
cel.load('columnIndex');
return context.sync().then(function () {
var a = ws.getCell(2, 2);
var txt = cel.columnIndex;
a.values = txt;
return context.sync();
})
});
}
Does Not work on Excel Online, Throws the same exception, "GeneralException"
Just to clarify, $scope is just an angular object needed to call this function when the button is clicked in the Panel on Excel.
from office-js.
@forlemon , thanks for showing the code sample.
I ran it in Office Online using Script Lab, and it worked fine. So I'm guessing that it's not a framework bug per se, but rather the way that you're hooking up Angular.
It sounds somewhat akin to the issue described in https://stackoverflow.com/a/44118441/678505. Do you have an "Office.initialized()" somewhere on the page, and are you sure that it's firing?
from office-js.
Yes I have an "Office.initialized()".
I've even put it like this:
Office.initialize = function (reason) {
$(document).ready(function () {
$('#test').click(function test() {
Excel.run(function (context) {
var ws = context.workbook.worksheets.getActiveWorksheet();
var cel = ws.getCell(1, 1);
cel.load('columnIndex');
return context.sync().then(function () {
var a = ws.getCell(2, 2);
var txt = cel.columnIndex;
a.values[0][0] = txt;
return context.sync();
})
});
});
});
};
And it still throws GeneralException after this line "return context.sync().then(function () {"
I couldn't make it even work on ScriptLab, no results and no console errors or message.
But sideloading the add in, and executing that function on a simple button, throws the error once again.
from office-js.
In Script Lab, you don't need an Office.initialize. Having one would actually throw Script Lab off. Script Lab is meant as a simplified playground, where you only need to write in the "interesting" bit of code -- whereas we take care of the backend infrastructure.
Just to check: if you had only the inner code in Script Lab, does it work for you in Office Online?
$('#test').click(function () {
Excel.run(function (context) {
var ws = context.workbook.worksheets.getActiveWorksheet();
var cel = ws.getCell(1, 1);
cel.load('columnIndex');
return context.sync().then(function () {
var a = ws.getCell(2, 2);
var txt = cel.columnIndex;
a.values[0][0] = txt;
return context.sync();
})
});
});
from office-js.
It throws an error saying the values property is not loaded
It shows this output(it's in portuguese though):
Unhandled Promise rejection: A propriedade "values" não está disponível. Antes de ler o valor da propriedade, chame o método de carregamento no objeto contentor e chame "context.sync()" no contexto de pedido associado. ; Zone: <root> ; Task: Promise.then ; Value: PropertyNotLoaded: A propriedade "values" não está disponível. Antes de ler o valor da propriedade, chame o método de carregamento no objeto contentor e chame "context.sync()" no contexto de pedido associado. {...} Error: A propriedade "values" não está disponível. Antes de ler o valor da propriedade, chame o método de carregamento no objeto contentor e chame "context.sync()" no contexto de pedido associado.
at r.ZoneAwareError (https://script-lab.azureedge.net/bundles/polyfills.2e9078c49c55fa18c57b.bundle.js:1:77489)
at new r (https://appsforoffice.microsoft.com/lib/1/hosted/excel-web-16.00.js:21:283042)
at t.throwIfNotLoaded (https://appsforoffice.microsoft.com/lib/1/hosted/excel-web-16.00.js:21:335136)
at k.get [as values] (https://appsforoffice.microsoft.com/lib/1/hosted/excel-web-16.00.js:21:379271)
at https://script-lab-runner.azureedge.net/compile/page:15:27
at ZoneDelegate.invoke (https://script-lab.azureedge.net/bundles/polyfills.2e9078c49c55fa18c57b.bundle.js:1:85192)
at Zone.run (https://script-lab.azureedge.net/bundles/polyfills.2e9078c49c55fa18c57b.bundle.js:1:80018)
at https://script-lab.azureedge.net/bundles/polyfills.2e9078c49c55fa18c57b.bundle.js:1:77231
at ZoneDelegate.invokeTask (https://script-lab.azureedge.net/bundles/polyfills.2e9078c49c55fa18c57b.bundle.js:1:85935)
at Zone.runTask (https://script-lab.azureedge.net/bundles/polyfills.2e9078c49c55fa18c57b.bundle.js:1:80709)
at drainMicroTaskQueue (https://script-lab.azureedge.net/bundles/polyfills.2e9078c49c55fa18c57b.bundle.js:1:75411)
at ZoneTask.invoke (https://script-lab.azureedge.net/bundles/polyfills.2e9078c49c55fa18c57b.bundle.js:1:86983)
Error: Uncaught (in promise): PropertyNotLoaded: A propriedade "values" não está disponível. Antes de ler o valor da propriedade, chame o método de carregamento no objeto contentor e chame "context.sync()" no contexto de pedido associado.
Error: A propriedade "values" não está disponível. Antes de ler o valor da propriedade, chame o método de carregamento no objeto contentor e chame "context.sync()" no contexto de pedido associado.
at r.ZoneAwareError (https://script-lab.azureedge.net/bundles/polyfills.2e9078c49c55fa18c57b.bundle.js:1:77489)
at new r (https://appsforoffice.microsoft.com/lib/1/hosted/excel-web-16.00.js:21:283042)
at t.throwIfNotLoaded (https://appsforoffice.microsoft.com/lib/1/hosted/excel-web-16.00.js:21:335136)
at k.get [as values] (https://appsforoffice.microsoft.com/lib/1/hosted/excel-web-16.00.js:21:379271)
at https://script-lab-runner.azureedge.net/compile/page:15:27
at ZoneDelegate.invoke (https://script-lab.azureedge.net/bundles/polyfills.2e9078c49c55fa18c57b.bundle.js:1:85192)
at Zone.run (https://script-lab.azureedge.net/bundles/polyfills.2e9078c49c55fa18c57b.bundle.js:1:80018)
at https://script-lab.azureedge.net/bundles/polyfills.2e9078c49c55fa18c57b.bundle.js:1:77231
at ZoneDelegate.invokeTask (https://script-lab.azureedge.net/bundles/polyfills.2e9078c49c55fa18c57b.bundle.js:1:85935)
at Zone.runTask (https://script-lab.azureedge.net/bundles/polyfills.2e9078c49c55fa18c57b.bundle.js:1:80709)
at drainMicroTaskQueue (https://script-lab.azureedge.net/bundles/polyfills.2e9078c49c55fa18c57b.bundle.js:1:75411)
at ZoneTask.invoke (https://script-lab.azureedge.net/bundles/polyfills.2e9078c49c55fa18c57b.b
If I load the property it just doesn't do nothing, no change on the cell (2,2) and no message on the console.
from office-js.
Ah, right. Sorry, this code is different from what you'd once had, though :-)
Instead of a.values[0][0] = txt
, you need a.values = [[txt]]
. There is something special about array-handling in particular, where you have to set the entire array at once, not piece-meal. More info here: http://buildingofficeaddins.com/array-properties/.
Try it now with a.values = [[txt]]
from office-js.
It worked on ScriptLab!
But the same function in the context of the Add-In, this happens:
It does not it the breakpoint.
But this does not happen on Desktop Excel
from office-js.
I am not sure what is happening.
If you can create the absolute minimal repro project, I can try to take a look. By minimal, I mean something that has little extraneous stuff, and where I can just do a simple "npm install" "npm start" or equivalent to run it locally. It seems like it's something in your hookup between your framework code and the Office code, but I can try to help if I see the full source code and can debug it on my computer.
from office-js.
I've created a Visual Studio Excel Add In project that only has this html and this javascript. Published it on a server and ran the Manifest on excel Online. Same exception:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<title>Excel Add-In: Xporter Snippets</title>
<script src="Scripts/jquery-3.1.1.js" type="text/javascript"></script>
<script src="Scripts/FabricUI/MessageBanner.js" type="text/javascript"></script>
<script src="Scripts/jquery.fabric.min.js"></script>
<script src="Scripts/angular.js"></script>
<link href="Content/Office.css" rel="stylesheet" type="text/css" />
<script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js" type="text/javascript"></script>
<link rel="stylesheet" href="Content/fabric.min.css" />
<link rel="stylesheet" href="Content/fabric.components.css" />
<script src="Scripts/Jquery.NavBar.js"></script>
<!-- To enable offline debugging using a local reference to Office.js, use: -->
<!-- <script src="Scripts/Office/MicrosoftAjax.js" type="text/javascript"></script> -->
<!-- <script src="Scripts/Office/1/office.js" type="text/javascript"></script> -->
<link href="ExcelSnippets.css" rel="stylesheet" type="text/css" />
<script src="ExcelSnippets.js" type="text/javascript"></script>
<!-- For the Office UI Fabric, go to https://aka.ms/office-ui-fabric to learn more. -->
<!-- To enable the offline use of Office UI Fabric, use: -->
</head>
<!-- Angular controller that has all the scope variables to be used to create the web page -->
<body >
<button class="ms-Button" style="margin-top:20%;" id="test">
<span class="ms-Button-label">TEST</span>
</button>
</body>
</html>
(function () {
"use strict";
// The initialize function must be run each time a new page is loaded.
Office.initialize = function (reason) {
$(document).ready(function () {
$('#test').click(function test() {
Excel.run(function (context) {
var ws = context.workbook.worksheets.getActiveWorksheet();
var cel = ws.getCell(1, 1);
cel.load('columnIndex');
var a = ws.getCell(2, 2);
a.load('values');
return context.sync().then(function () {
var txt = cel.columnIndex;
a.values = [[txt]];
return context.sync();
})
});
});
});
};
})();
from office-js.
I reached out for someone on our team to help investigate.
from office-js.
(For the record, for internal folks: this is ICM issue 57542289)
from office-js.
Is there any news regarding this?
from office-js.
@forlemon I have tried your simplified code on Excel Online, but cannot repro the issue. The snippet completes successfully without any exceptions.
I wonder if you could give us more details about it?
Normally, by executing the simplified snippet you gave, it will send in a couple of requests to ExecuteRichApiRequest and GetRangeContent. Could you please turn-on the Network capture just before you click the TEST button, and see if those requests are completed successfully? And could you please give us the correlation IDs from the headers of each responses, so that we can diagnose the issue more easily?
from office-js.
CorrelationId: "09c326b9-b646-407d-82a1-89b5cbe13bfc"
from office-js.
@forlemon Thank you for your response. We found this is likely to be a bug in the Office Online. We are working to get it fixed.
from office-js.
Any updates?
from office-js.
Hi team,
Is there any progress on this? We are creating a new add-in and we are unable to finish some feature because we are depending on this fix.
Could you give us some update?
Cheers,
Rui Rodrigues
from office-js.
I am also having the same bug
My Code is
Excel.run((context) ->
sheet = context.workbook.worksheets.getItem(s_name)
response_data = {"A1"=>"1000","A2"=>"1001","B1"=>"1000","B2"=>"1001","C1"=>"1000","C2"=>"1001"} # similary 54000+ records
angular.forEach response_data, (key, value) ->
range = sheet.getRange(key)
range.values = [[ value ]]
context.sync().then ->
console.log("Data synchronized")
return
).catch (error) ->
console.log 'Error: ' + error
My Excel version is
I am having issue is Excel Online
from office-js.
Related Issues (20)
- Task Pane for OWA add-ins doesn't open for shared mailbox HOT 6
- Sideloaded outlook add-in does not open on OWA and New outlook app HOT 2
- Word: `NotImplemented` error from `paragraph.getText` on 16.0.17328.20550 HOT 5
- Can't access outlook web add-in in shared mailbox when using the "Open another mailbox" HOT 6
- Custom functions not registered when Excel is launched via COM Automation; any recalculation causes #NAME! or #VALUE! error. HOT 2
- Inconsistent behavior of `MoveSpamItemTo` between Outlook classic and Outlook web, when current folder is a shared mailbox
- There are multiple bugs in the method 'Office.context.mailbox.item.getComposeTypeAsync‘
- office.js - getSharedPropertiesAsync doesnt work when called HOT 7
- Integrated spam reporting add-in post-processing doesn't trigger when email opened in new window
- Central Deployment (Integrated Apps) does not update the OOXML version when AutoShowTaskpaneWithDocument is configured HOT 6
- Unable to Get the Top Position of the Current Page having Cursor using Office.js HOT 2
- "Send" button in outlook freezes when restarting outlook and sending mail for first time in new (pop out) window for ItemSend add-in HOT 2
- On web, the system cannot handle some large html inserted on a content control HOT 2
- Addin fails to load in trident (Outlook) systems when NAA-SSO authentication is used. HOT 3
- Not able to see sideloaded app under apps ribbon of mail read form in new outlook web HOT 1
- Issue with Inserting and Retrieving <hr> Tag in Word Using Office JS API HOT 1
- From group we can upload sensitive file, in that case on send adding not get trigger, so sensitive file/folder/templates get uploaded HOT 2
- NAA: Unable to acquire access token in taskpane on Outlook for Windows HOT 1
- Emails Scheduled with 'Office.context.mailbox.item.delayDeliveryTime' Not Sending at Specified Time. HOT 5
- Need more properties in RangeArea object like Excel.Range object
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from office-js.