Reputation: 569
It would make my user's lives much easier if I could do the following;
Allow an Excel document to be viewed (not edited) in Internet Explorer 8
Facilitate jumping to particular sheets in that document
I can embed the Excel file using an iframe which works, but I am utterly stuck when it comes to jumping to a particular named worksheet in that document.
Is this possible? I'm thinking either some way to force the document to show a particular worksheet first, via the src attribute, or controlling the embeded doc via javascript.
Upvotes: 4
Views: 1697
Reputation: 21684
Thought of something. Use AJAX, post back when HTML element changes, re-serve the workbook with a modified open workbook macro that uses the post back data to display the proper worksheet and range. Since there is no browser refresh flash, the user may/will never notice. The only downside, is the round-trip back to the server.
Upvotes: 0
Reputation: 9422
Have you tried the PHP excel reader? I used it for similar purposes once. http://sourceforge.net/projects/phpexcelreader/
Upvotes: 1
Reputation: 21684
If you are serving XMLSS you can specify the ActiveSheet, ActiveRow, and ActiveCol. If you are using a third-party control, they usually have a way to set the active sheet and range. If you are serving a HTML table or cvs, you are out of luck.
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
<ActiveSheet>1</ActiveSheet>
</ExcelWorkbook>
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
<Selected/>
<Panes>
<Pane>
<Number>3</Number>
<ActiveRow>16</ActiveRow>
<ActiveCol>5</ActiveCol>
</Pane>
</Panes>
</WorksheetOptions>
Upvotes: 1
Reputation: 2211
I am not sure if you can do this with JavaScript. But another question. Do you generate this file on the server side? Then you could embed some macro which would jump to this partcular worksheet.
Upvotes: 0