埋め込んだExcelワークブックのシート数を取得するコードです。
<script type="text/javascript" src="http://r.office.microsoft.com/r/rlidExcelWLJS?v=1&kip=1"></script> <script type="text/javascript"> var fileToken = "SD92A165759188B352!265/-7880906317294423214/"; if (window.attachEvent) { window.attachEvent("onload", loadEwaOnPageLoad); } else { window.addEventListener("DOMContentLoaded", loadEwaOnPageLoad, false); } function loadEwaOnPageLoad() { var props = { uiOptions: { showGridlines: false, showRowColumnHeaders: false, selectedCell: "'Sheet1'!A1" }, interactivityOptions: { } }; Ewa.EwaControl.loadEwaAsync(fileToken, "myExcelDiv", props, onEwaLoaded); } function onEwaLoaded(result) { ewa = Ewa.EwaControl.getInstances().getItem(0); } function fnc() { alert("シート数:" + ewa.getActiveWorkbook().getSheets().getCount()); } </script> <input type="button" value="シート数表示" onclick="fnc();"></input><br> <div id="myExcelDiv" style="width: 400px; height: 100px"></div>
・Ewa.SheetCollection.getCount()
http://msdn.microsoft.com/en-us/library/ee660086.aspx
この記事へのコメントはありません。