{"id":1060,"date":"2011-12-15T11:40:06","date_gmt":"2011-12-15T02:40:06","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=1060"},"modified":"2011-12-15T11:40:06","modified_gmt":"2011-12-15T02:40:06","slug":"excel-services-ecmascriptactiveworkbook%e3%81%ae%e3%82%b7%e3%83%bc%e3%83%88%e6%95%b0%e3%82%92%e5%8f%96%e5%be%97%e3%81%99%e3%82%8b%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=1060","title":{"rendered":"[Excel Services ECMAScript]ActiveWorkbook\u306e\u30b7\u30fc\u30c8\u6570\u3092\u53d6\u5f97\u3059\u308b\u3002"},"content":{"rendered":"<p>\u57cb\u3081\u8fbc\u3093\u3060Excel\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u306e\u30b7\u30fc\u30c8\u6570\u3092\u53d6\u5f97\u3059\u308b\u30b3\u30fc\u30c9\u3067\u3059\u3002<br \/>\n<!--more--><\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">&lt;script type=&quot;text\/javascript&quot; src=&quot;http:\/\/r.office.microsoft.com\/r\/rlidExcelWLJS?v=1&amp;kip=1&quot;&gt;&lt;\/script&gt;\r\n&lt;script type=&quot;text\/javascript&quot;&gt;\r\n    var fileToken = &quot;SD92A165759188B352!265\/-7880906317294423214\/&quot;;\r\n\r\n    if (window.attachEvent) {\r\n        window.attachEvent(&quot;onload&quot;, loadEwaOnPageLoad);\r\n    } else {\r\n        window.addEventListener(&quot;DOMContentLoaded&quot;, loadEwaOnPageLoad, false);\r\n    }\r\n\r\n    function loadEwaOnPageLoad() {\r\n        var props = {\r\n            uiOptions: {\r\n                showGridlines: false,\r\n                showRowColumnHeaders: false,\r\n                selectedCell: &quot;'Sheet1'!A1&quot;\r\n            },\r\n            interactivityOptions: { }\r\n        };\r\n\r\n        Ewa.EwaControl.loadEwaAsync(fileToken, &quot;myExcelDiv&quot;, props, onEwaLoaded);\r\n    }\r\n\r\n    function onEwaLoaded(result) {\r\n        ewa = Ewa.EwaControl.getInstances().getItem(0);\r\n    }\r\n    \r\n    function fnc() {\r\n        alert(&quot;\u30b7\u30fc\u30c8\u6570\uff1a&quot; + ewa.getActiveWorkbook().getSheets().getCount());\r\n    }\r\n&lt;\/script&gt;\r\n&lt;input type=&quot;button&quot; value=&quot;\u30b7\u30fc\u30c8\u6570\u8868\u793a&quot; onclick=&quot;fnc();&quot;&gt;&lt;\/input&gt;&lt;br&gt;\r\n&lt;div id=&quot;myExcelDiv&quot; style=&quot;width: 400px; height: 100px&quot;&gt;&lt;\/div&gt;<\/pre>\n<p><script type=\"text\/javascript\" src=\"http:\/\/r.office.microsoft.com\/r\/rlidExcelWLJS?v=1&#038;kip=1\"><\/script><br \/>\n<script type=\"text\/javascript\">\n    var fileToken = \"SD92A165759188B352!265\/-7880906317294423214\/\";<\/p>\n<p>    if (window.attachEvent) {\n        window.attachEvent(\"onload\", loadEwaOnPageLoad);\n    } else {\n        window.addEventListener(\"DOMContentLoaded\", loadEwaOnPageLoad, false);\n    }<\/p>\n<p>    function loadEwaOnPageLoad() {\n        var props = {\n            uiOptions: {\n                showGridlines: false,\n                showRowColumnHeaders: false,\n                selectedCell: \"'Sheet1'!A1\"\n            },\n            interactivityOptions: { }\n        };<\/p>\n<p>        Ewa.EwaControl.loadEwaAsync(fileToken, \"myExcelDiv\", props, onEwaLoaded);\n    }<\/p>\n<p>    function onEwaLoaded(result) {\n        ewa = Ewa.EwaControl.getInstances().getItem(0);\n    }<\/p>\n<p>    function fnc() {\n        alert(\"\u30b7\u30fc\u30c8\u6570\uff1a\" + ewa.getActiveWorkbook().getSheets().getCount());\n    }\n<\/script><br \/>\n<input type=\"button\" value=\"\u30b7\u30fc\u30c8\u6570\u8868\u793a\" onclick=\"fnc();\"><\/input><\/p>\n<div id=\"myExcelDiv\" style=\"width: 400px; height: 100px\"><\/div>\n<p><strong>\u30fbEwa.SheetCollection.getCount()<\/strong><br \/>\n<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ee660086.aspx\" title=\"Ewa.SheetCollection.getCount()\" target=\"_blank\">http:\/\/msdn.microsoft.com\/en-us\/library\/ee660086.aspx<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\u57cb\u3081\u8fbc\u3093\u3060Excel\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u306e\u30b7\u30fc\u30c8\u6570\u3092\u53d6\u5f97\u3059\u308b\u30b3\u30fc\u30c9\u3067\u3059\u3002","protected":false},"author":1,"featured_media":7111,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,41],"tags":[38,39,40,140],"class_list":["post-1060","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-excel-services-ecmascript","tag-office-web-apps","tag-excel-web-app","tag-excelmashup","tag-excel-services-ecmascript"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-Excel.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-h6","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1060","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1060"}],"version-history":[{"count":2,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1060\/revisions"}],"predecessor-version":[{"id":1062,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1060\/revisions\/1062"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7111"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1060"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1060"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1060"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}