Detect when workbook is activated / deactivated - OfficeJS Add-in - excel

Can an OfficeJS add-in detect whether or not an Excel workbook has been activated or deactivated? For example, when a user clicks away from an add-in hosted workbook to go to a different workbook / application (or goes from a different application to the add-in hosted workbook).

This is planned in requirement set 1.8, and the work is in progress. Please visit the OpenSpec for Excel at https://github.com/OfficeDev/office-js-docs/tree/ExcelJs_OpenSpec.

Related

Office js Excel Add-In Sharing state across workbooks

I have recently moved from developing VBA Excel Add-Ins to using the new Office JavaScript Add-ins platform. I am used to my VBA Add-In being active across the whole of Excel and the state of the variables is available no matter what workbook you are interacting with.
This does not seem to be the case with JavaScript Add-ins. I have been testing my Add-In and happened to create a new workbook and noticed that none of the Add-In state appeared to be active any longer.
Am I missing something or is this a consequence of the new Office JavaScript Add-ins architecture where it runs inside a browser within Excel?
Just to confirm I have already enabled the Shared Runtime option, that is not my question. I am able to share state between Commands, Takspane and Functions. But all within a single workbook.
I have tried one of the example Yeoman generator for Office Add-ins and it certainly seems that global variables are not shared between the Add-In in two different workbooks.
This behavior is expected. With Office (web) add-ins, each add-in runs in an embedded JavaScript runtime that is a completely separate process from Office and any other add-ins, so it cannot share data across add-ins. Some people have made sharing across add-ins work using the OfficeRuntime.storage object, but it only works in Windows. It won't work on Mac or in Office on the web. Frankly, the Office platform team considers it a bug that it can be done on Windows and that may be fixed at any time, so you should not create an add-in that depends on it even if you know your add-in will only be run on Windows.
Depending on what your scenario is, you might be able to store state in the document with either Office.document.settings or Office.document.customXmlParts. Another possibility is to store state in a database on your server side.

How to get objects and VBA functions to work in Excel for Office 365?

Created a workbook in Excel desktop that uses buttons and hyperlinks to run VBA functions. When
workbook loaded in browser-based Office 365, buttons do not appear and clicking hyperlinks gives
Sorry, we couldn't open this link. The link address may be invalid, or you may not have permission to open it.
How do I get desktop hyperlink and button functionality to port to Office 365?
You need to develop a Web add-in if you want to get your extra functionality working everywhere, see Excel add-ins overview. VBA is for Windows desktop applications only.

How to convert Excel macro enabled workbook for use on mobile phone?

I created a macro enabled workbook to enter information on the worksheet and to e-mail it.
I downloaded Excel for mobile but all macros are disabled.
Is there a way to make it so the workbook could be used on a mobile phone?
Unfortunately, the VBA engine does not function on the mobile version of Excel. Macro-enabled Workbooks (.xlsx) will open, but the macros will not run. Macro-enabled Templates (.xltm) and Add-Ins (.xla and .xlam) won't even open.
See Microsoft's support article Why can't I open my Excel File? for more information and a complete breakdown by file type and mobile OS.

Hidden Excel Application gets visible when user opens new workbooks

I am using Excel Interop inside my C# Desktop Application to open a hidden Excel Application in the Background, which reads data of some Excel files.
Works fine so far, until the user opens his own workbooks with the Windows Explorer. His Workbooks are opened in my Excel Application, which gets visible and the hidden workbooks too. Then he can close the Application, which crashes my Process.
Is there any possibility to get my Excel application blocked, so the user gets his own Excel Application if he opens workbooks?
Not exactly answering your question, but you can try using the OpenXML SDK to read the contents of the Excel files. Using this SDK, you won't be launching any instance of Excel at all.
Have a look at the following links for reference
https://msdn.microsoft.com/en-us/library/office/cc823095.aspx
https://msdn.microsoft.com/en-us/library/office/gg575571.aspx

Reload workbook in SharePoint 2010 Excel Web Access

I am developing a webpage for users to view some Excel workbooks in SharePoint webpage.
The workbook is a kind of report to users and will be updated by admin every week by overwrite the excel file in SharePoint.
I know we can reload the workbook manually by clicking File->Reload Workbook. However, if we take this appoarch, every user needs to click the button on their own which is not what we want!! So I would like to do this automatically.
Is there any method to solve this? Any advice is welcome!!
This post my help you.The approach is adding a javascript code to XLViewer.aspx in order to immediately refresh the connections of the Excel Services viewer on every visit.
https://sharepoint.stackexchange.com/questions/28190/how-to-reload-worksheet-displayed-in-excel-web-access-webpart

Resources