埋め込んだ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("ActiveWorkbookのパス:" + ewa.getActiveWorkbook().getWorkbookPath()); } </script> <input type="button" value="パス表示" onclick="fnc();"></input><br> <div id="myExcelDiv" style="width: 400px; height: 100px"></div>
・Ewa.Workbook.getWorkbookPath()
http://msdn.microsoft.com/en-us/library/ee660126.aspx
この記事へのコメントはありません。