-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
General Exception on context.sync after loading custom workbook properties with Excel Online only #179
Comments
@petehallett
|
@Rick-Kirkham Thanks for following up on this. @petehallett Thanks for letting us know the issue, and sorry about the problem. I could repro the issue on my side. It happens when you have an workbook with no custom properties and you try to call customProperties.load() in Excel Online. I have located the bug and I will have a fix on it very soon. I will let you know once the fix is checked-in. For now, here are a few workaround you could do. Generally, we strongly recommend you never do an empty load on a proxy object. When you do an empty load call like proxyObject.load(), it will try to get you every property and call some hidden method under the proxy object, which is unnecessary in most scenarios. If you want to call a method, you don't need to call any load. For example, in your scenarios, you could just call
If you want to get some properties under the proxy object, you could specify those properties in the "load" call instead of doing an empty load. For example, if you want to load the name and postion of a worksheet, you could do:
Avoiding empty "load" calls will have a huge improvement on the performance of your add-in. Also in this case, if you change your code to the first snippet above, you could avoid hitting the bug. Though we don't recommend you to do empty call, it should never throw an exception. Again, I apologize for the inconvenience and we will have the bug fixed very soon. |
Seems to be an issue with @petehallett 's code. awaiting for him to validate before closing. |
@tong-1324
However the other option of specifying the properties in the load call also produces the General Exception error. i.e.
This is once again only occurring within Excel Online. Not Desktop or Word Desktop or Word online. I appreciate that you have found the bug and are looking for a resolution. Thank you again for your assistance. |
This is my workaround method to load items. If you ensure that count is greater than 0, you can safely load customProperties.
|
follow coding practice described on the issue. |
Thanks to all contributors for your assistance with this issue.@tong-1324, will you be posting an update on this issue once the fix is checked in? Thanks again. |
I'm working on a project that requires access to the Custom Properties of a Workbook. i.e.
context.workbook.properties.custom;
I need to check to see if there are any Custom Properties in the workbook when I load the TaskPane.
My project works with Word Desktop, Word Online, Excel Desktop however produces an error in Excel Online.
I have created a sample project to demonstrate this problem. I need to test to see if there are any custom properties with a workbook.
I have a Custom properties Object, the Custom Properties are loaded then a general Exception error is thrown when context.sync is run.
Error: GeneralException: There was an internal error while processing the request.
Expected Behavior
When opening a Workbook with either, no custom properties, (i.e. a New Workbook) or an existing workbook with Custom properties, the expected
behaviour is that the Custom Properties are loaded into the object, as is demonstrated when using Word Desktop, Word Online or Excel Desktop.
Current Behavior
I can successfully load Custom Properties from Word Desktop, Word Online or Excel Desktop. This can be from a blank Document/Workbook or a Document/Workbook that currently has custom properties.
I currently receive the General Exception Error when using Excel Online, NOT Word Desktop, Word Online or Excel Desktop.
Steps to Reproduce, or Live Example
Below is a sample of my code from my sample TaskPane. The error will be reproduced when the
TestCustomProperty()
function is called.Context
We are trying to create a single Add-in that can be used across Word and Excel, both Online and Desktop version.
My add-in works sucessfully in Word Desktop, Online and Excel Desktop, however not Excel Online. Without being able to target Excel Online, we will be limiting the potential of our Add-in.
Your Environment
Useful logs
Home.js:78 Error: GeneralException: There was an internal error while processing the request.
Home.js:80 Debug info: {"code":"GeneralException","message":"There was an internal error while processing the request.","errorLocation":"","statement":"custom.load();","surroundingStatements":["var workbook=context.workbook;","var properties=workbook.properties;","var custom=properties.custom;","// >>>>>","custom.load();","// <<<<<","custom.getCount();"],"fullStatements":["Please enable config.extendedErrorLogging to see full statements."]}
The text was updated successfully, but these errors were encountered: