Simple repro steps - Create an Excel app for task pane app for Excel client application Use the below function to print the document name in the task pane Build and add the addin manifest in the trusted Add-in catalog so you can insert it into any Excel document. Launch Excel (a new blank workbook will come up) Click the button to execute the below code You will see blank string in the workbook name Next- save the workbook and then click the button again you will see the correct name displayed in your add-in
function getDataFromSelection() {
Office.context.document.getSelectedDataAsync(Office.CoercionType.Text,
function (result) {
if (result.status === Office.AsyncResultStatus.Succeeded) {
Office.context.document.getFilePropertiesAsync(function (asyncResult) {
app.showNotification('The document URL is:', '"' + Office.context.document.url + '"');
})
}
}
);
I have an app for Excel
I am trying to read the name of the URL (document name) It works fine in online When the same addin is used in Excel client app it gives correct result for a saved document.
But
When the a new workbook is launched with name eg - Book1.xlsx and we try to print the Office.context.document.url to get the name, we get an empty string.
Is this by design or a bug? is there a way to get the name of the default unsaved document?