I want to have a webpart working when a file is open. I saw that text files are open in a blank page, but Excel files are open within a SharePoint page, in which I cannot edit/see a web part zone.
So, I was wondering if it’s possible to add a webpart in that view, so I can execute some actions when a file is open.
Thanks in advance!
The page opened is XLViewer.aspx from the layouts directory. It is bad practice to edit out of the box files so I would copy the file into a custom directory and then add a web part zone to it. I would then use jquery to change the onclick event of the Excel file links to point to your custom page.
Alternatively, XLViewer.aspx uses minimal.master as its master page, so you could add your web part to minimal.master in SharePoint Designer. I would then code the web part to be dormant unless the page is XLViewer.aspx.