{"id":9051,"date":"2017-08-15T15:00:55","date_gmt":"2017-08-15T06:00:55","guid":{"rendered":"https:\/\/www.ka-net.org\/blog\/?p=9051"},"modified":"2017-08-15T15:26:16","modified_gmt":"2017-08-15T06:26:16","slug":"office%e3%82%a2%e3%83%89%e3%82%a4%e3%83%b3%e3%83%86%e3%83%bc%e3%83%96%e3%83%ab%e3%82%84%e3%82%b0%e3%83%a9%e3%83%95%e3%82%92%e4%bd%9c%e6%88%90%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95excel","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=9051","title":{"rendered":"[Office\u30a2\u30c9\u30a4\u30f3]\u30c6\u30fc\u30d6\u30eb\u3084\u30b0\u30e9\u30d5\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5(Excel)"},"content":{"rendered":"<p>\u304a\u4e45\u3057\u3076\u308a\u306eOffice \u30a2\u30c9\u30a4\u30f3\u306e\u8a18\u4e8b\u3067\u3059\u3002<br \/>\n\u6ce8\u76ee\u3057\u3066\u3044\u308b\u4eba\u306f\u307b\u3068\u3093\u3069\u3044\u307e\u305b\u3093\u304c\u3001<a href=\"https:\/\/github.com\/OfficeDev\/office-js-docs\/tree\/ExcelJs_OpenSpec\" title=\"Excel JavaScript API Open Specification\" target=\"_blank\">Excel JavaScript API\u306e\u30ea\u30ea\u30fc\u30b9\u4e88\u5b9a<\/a>\u3092\u898b\u308c\u3070\u5206\u304b\u308b\u901a\u308a\u3001Office \u30a2\u30c9\u30a4\u30f3\u306f\u5e38\u306b\u9032\u5316\u3057\u7d9a\u3051\u3066\u304a\u308a\u3001\u3067\u304d\u308b\u3053\u3068\u3082\u5c11\u3057\u305a\u3064\u5897\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001<i>\u300cOffice \u30a2\u30c9\u30a4\u30f3\u3067\u3053\u3093\u306a\u3053\u3068\u3067\u304d\u308b\u3088\u300d<\/i>\u3068\u3044\u3046\u4e00\u4f8b\u306e\u7d39\u4ecb\u3068\u3057\u3066\u3001\u30c6\u30fc\u30d6\u30eb\u3084\u30b0\u30e9\u30d5\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3059\u3002<br \/>\n(\u672c\u5f53\u306f<a href=\"https:\/\/github.com\/OfficeDev\/office-js-docs\/blob\/ExcelJs_OpenSpec\/reference\/excel\/worksheetcollection.md#onactivated\" title=\"onActivated\" target=\"_blank\">onActivated<\/a>\u30a4\u30d9\u30f3\u30c8\u3068\u304b\u3092\u8a66\u3057\u305f\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u30012017\u5e748\u6708\u6642\u70b9\u3060\u3068\u307e\u3060API\u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u3066\u304a\u3089\u305a\u3001\u8a66\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f)<\/p>\n<h4 class=\"style4a\">\u30de\u30cb\u30d5\u30a7\u30b9\u30c8<\/h4>\n<p><span style=\"color: #ff0000; font-weight: bold;\">\u203b Id\u8981\u7d20\u3084SourceLocation\u8981\u7d20\u306eDefaultValue\u5c5e\u6027\u306e\u5024\u7b49\u306f\u9069\u5f53\u306b\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/span><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\r\n&lt;OfficeApp xmlns=&quot;http:\/\/schemas.microsoft.com\/office\/appforoffice\/1.1&quot; xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:type=&quot;TaskPaneApp&quot;&gt;\r\n  &lt;Id&gt;3648a44b-1eef-42fc-a713-eb78549613b8&lt;\/Id&gt;\r\n  &lt;Version&gt;1.0&lt;\/Version&gt;\r\n  &lt;ProviderName&gt;@kinuasa&lt;\/ProviderName&gt;\r\n  &lt;DefaultLocale&gt;ja-jp&lt;\/DefaultLocale&gt;\r\n  &lt;DisplayName DefaultValue=&quot;Sample Add-in&quot; \/&gt;\r\n  &lt;Description DefaultValue=&quot;Sample Add-in&quot;\/&gt;\r\n  &lt;Hosts&gt;\r\n    &lt;Host Name=&quot;Workbook&quot; \/&gt;\r\n  &lt;\/Hosts&gt;\r\n  &lt;AppDomains&gt;\r\n    &lt;AppDomain&gt;https:\/\/login.microsoftonline.com&lt;\/AppDomain&gt;\r\n  &lt;\/AppDomains&gt;\r\n  &lt;DefaultSettings&gt;\r\n    &lt;SourceLocation DefaultValue=&quot;https:\/\/localhost\/sample\/index.html&quot; \/&gt;\r\n  &lt;\/DefaultSettings&gt;\r\n  &lt;Permissions&gt;ReadWriteDocument&lt;\/Permissions&gt;\r\n&lt;\/OfficeApp&gt;<\/pre>\n<h4 class=\"style4a\">\u30b3\u30fc\u30c9(index.html)<\/h4>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n  &lt;head&gt;\r\n    &lt;meta charset=&quot;UTF-8&quot;&gt;\r\n    &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=Edge&quot;&gt;\r\n    &lt;title&gt;Sample&lt;\/title&gt;\r\n    &lt;link rel=&quot;stylesheet&quot; href=&quot;https:\/\/static2.sharepointonline.com\/files\/fabric\/office-ui-fabric-js\/1.4.0\/css\/fabric.components.min.css&quot;&gt;\r\n    &lt;style&gt;\r\n      #content-main {\r\n        background: #ffffff;\r\n        position: fixed;\r\n        top: 80px;\r\n        left: 0;\r\n        right: 0;\r\n        bottom: 0;\r\n        overflow: auto;\r\n      }\r\n    &lt;\/style&gt;\r\n    &lt;script src=&quot;https:\/\/ajax.aspnetcdn.com\/ajax\/jquery\/jquery-3.2.1.min.js&quot;&gt;&lt;\/script&gt;\r\n    &lt;script src=&quot;https:\/\/appsforoffice.microsoft.com\/lib\/1\/hosted\/office.js&quot;&gt;&lt;\/script&gt;\r\n    &lt;script src=&quot;https:\/\/unpkg.com\/core-js\/client\/core.min.js&quot;&gt;&lt;\/script&gt;\r\n    &lt;script src=&quot;https:\/\/unpkg.com\/@microsoft\/office-js-helpers@0.7.4\/dist\/office.helpers.min.js&quot;&gt;&lt;\/script&gt;\r\n    &lt;script src=&quot;https:\/\/static2.sharepointonline.com\/files\/fabric\/office-ui-fabric-js\/1.4.0\/js\/fabric.min.js&quot;&gt;&lt;\/script&gt;\r\n    &lt;script&gt;\r\n      Office.initialize = function(reason){\r\n        $(document).ready(function(){\r\n          $(&quot;#run&quot;).click(run);\r\n        });\r\n      };\r\n      \r\n      function run(){\r\n        try{\r\n          Excel.run(function(context){\r\n            \/\/const sheet = OfficeHelpers.ExcelUtilities.forceCreateSheet(context.workbook, &quot;Sample&quot;);\r\n            const sheet = context.workbook.worksheets.add(&quot;Sample&quot;); \/\/\u30b7\u30fc\u30c8\u8ffd\u52a0\r\n            \r\n            \/\/\u30c6\u30fc\u30d6\u30eb\u4f5c\u6210\r\n            const tbl = sheet.tables.add(&quot;A1:C1&quot;, true);\r\n            tbl.getHeaderRowRange().values = &#x5B;&#x5B;&quot;A&quot;, &quot;B&quot;, &quot;C&quot;]];\r\n            tbl.rows.add(null, &#x5B;\r\n              &#x5B;10, 20, 30],\r\n              &#x5B;11, 21, 31],\r\n              &#x5B;12, 22, 32],\r\n              &#x5B;13, 23, 33],\r\n              &#x5B;14, 24, 34],\r\n            ]);\r\n            \r\n            \/\/\u30b0\u30e9\u30d5\u4f5c\u6210\r\n            const chart = sheet.charts.add(&quot;ColumnClustered&quot;, tbl.getRange(), &quot;Auto&quot;);\r\n            chart.title.text = &quot;\u30c6\u30b9\u30c8\u7528\u30b0\u30e9\u30d5&quot;;\r\n            chart.setPosition(&quot;A8&quot;);\r\n            chart.legend.position = &quot;right&quot;\r\n            chart.legend.format.fill.setSolidColor(&quot;white&quot;);\r\n            chart.dataLabels.format.font.size = 15;\r\n            chart.dataLabels.format.font.color = &quot;black&quot;;\r\n            sheet.activate();\r\n            return context.sync();\r\n          }).then(function(){\r\n            OfficeHelpers.UI.notify(&quot;&quot;, &quot;Success&quot;, &quot;success&quot;);\r\n          });\r\n        }catch(error){\r\n          OfficeHelpers.UI.notify(error);\r\n        }\r\n      }\r\n    &lt;\/script&gt;\r\n  &lt;\/head&gt;\r\n  &lt;body&gt;\r\n    &lt;div id=&quot;content-main&quot;&gt;\r\n      &lt;button id=&quot;run&quot; class=&quot;ms-Button&quot;&gt;\r\n        &lt;span class=&quot;ms-Button-label&quot;&gt;Run Code&lt;\/span&gt;\r\n      &lt;\/button&gt;\r\n    &lt;\/div&gt;\r\n  &lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<h4 class=\"style4a\">\u5b9f\u884c\u753b\u9762<\/h4>\n<p>\u30a2\u30c9\u30a4\u30f3\u3092\u8aad\u307f\u8fbc\u3093\u3067\u300c<span style=\"color: #ff0000; font-weight: bold;\">Run Code<\/span>\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u300cSample\u300d\u30b7\u30fc\u30c8\u304c\u8ffd\u52a0\u3055\u308c\u3001\u30b7\u30fc\u30c8\u4e0a\u306b\u30c6\u30fc\u30d6\u30eb\u3068\u30b0\u30e9\u30d5\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/OfficeAddins_CreateChart_01.gif\" alt=\"\" width=\"746\" height=\"660\" class=\"alignnone size-full wp-image-9052\" \/><\/p>\n<p>Web\u9023\u643a\u3092\u5f97\u610f\u3068\u3059\u308bOffice \u30a2\u30c9\u30a4\u30f3\u3067Web\u4e0a\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u308a\u8fbc\u307f\u3001Excel\u30b7\u30fc\u30c8\u306b\u30b0\u30e9\u30d5\u3068\u3057\u3066\u51fa\u529b\u3057\u3066\u8996\u899a\u5316\u3059\u308b\u7b49\u3001\u30b0\u30e9\u30d5\u304c\u4f5c\u6210\u3067\u304d\u308b\u3060\u3051\u3067\u3082\u3001Office \u30a2\u30c9\u30a4\u30f3\u3092\u6d3b\u7528\u3057\u5f97\u308b\u5834\u9762\u306f\u591a\u3005\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<div id=\"single_banner_area2\" class=\"clearfix one_banner\">\n<div class=\"single_banner single_banner_left\">\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<!-- \u8a18\u4e8b\u4e2d(\u30c7\u30a3\u30b9\u30d7\u30ec\u30a4\u5e83\u544a\u30e6\u30cb\u30c3\u30c8) -->\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:block\"\r\n     data-ad-client=\"ca-pub-7306936664602087\"\r\n     data-ad-slot=\"5429724765\"\r\n     data-ad-format=\"auto\"\r\n     data-full-width-responsive=\"true\"><\/ins>\r\n<script>\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script>\n<\/div>\n<div class=\"single_banner single_banner_right\">\n<a href=\"\" target=\"_blank\"><img decoding=\"async\" src=\"\" alt=\"\" title=\"\" \/><\/a>\n<\/div>\n<\/div>\n\n<h4 class=\"style4a\">\u95a2\u9023Web\u30da\u30fc\u30b8<\/h4>\n<ul>\n<li>\u6700\u521d\u306e Excel \u30a2\u30c9\u30a4\u30f3\u3092\u30d3\u30eb\u30c9\u3059\u308b<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/msdn.microsoft.com\/ja-jp\/library\/office\/mt616491.aspx\" target=\"_blank\" title=\"\u6700\u521d\u306e Excel \u30a2\u30c9\u30a4\u30f3\u3092\u30d3\u30eb\u30c9\u3059\u308b\">https:\/\/msdn.microsoft.com\/ja-jp\/library\/office\/mt616491.aspx<\/a><\/li>\n<li>Office UI Fabric JS<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/dev.office.com\/fabric-js\/index.html\" target=\"_blank\" title=\"Office UI Fabric JS\">https:\/\/dev.office.com\/fabric-js\/index.html<\/a><\/li>\n<li>Excel JavaScript API requirement sets<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/github.com\/OfficeDev\/office-js-docs\/blob\/ExcelJs_OpenSpec\/reference\/requirement-sets\/excel-api-requirement-sets.md\" target=\"_blank\" title=\"Excel JavaScript API requirement sets\">https:\/\/github.com\/OfficeDev\/office-js-docs\/blob\/ExcelJs_OpenSpec\/reference\/requirement-sets\/excel-api-requirement-sets.md<\/a><\/li>\n<li>Excel JavaScript API Open Specification<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/github.com\/OfficeDev\/office-js-docs\/tree\/ExcelJs_OpenSpec\" target=\"_blank\" title=\"Excel JavaScript API Open Specification\">https:\/\/github.com\/OfficeDev\/office-js-docs\/tree\/ExcelJs_OpenSpec<\/a><\/li>\n<li>Worksheet Object (JavaScript API for Excel)<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/github.com\/OfficeDev\/office-js-docs\/blob\/ExcelJs_OpenSpec\/reference\/excel\/worksheet.md\" target=\"_blank\" title=\"Worksheet Object (JavaScript API for Excel)\">https:\/\/github.com\/OfficeDev\/office-js-docs\/blob\/ExcelJs_OpenSpec\/reference\/excel\/worksheet.md<\/a><\/li>\n<li>Range Object (JavaScript API for Excel)<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/github.com\/OfficeDev\/office-js-docs\/blob\/ExcelJs_OpenSpec\/reference\/excel\/range.md\" target=\"_blank\" title=\"Range Object (JavaScript API for Excel)\">https:\/\/github.com\/OfficeDev\/office-js-docs\/blob\/ExcelJs_OpenSpec\/reference\/excel\/range.md<\/a><\/li>\n<li>ChartCollection Object (JavaScript API for Excel)<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/github.com\/OfficeDev\/office-js-docs\/blob\/master\/reference\/excel\/chartcollection.md\" target=\"_blank\" title=\"ChartCollection Object (JavaScript API for Excel)\">https:\/\/github.com\/OfficeDev\/office-js-docs\/blob\/master\/reference\/excel\/chartcollection.md<\/a><\/li>\n<li>ChartCollection \u30aa\u30d6\u30b8\u30a7\u30af\u30c8 (JavaScript API for Excel)<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/github.com\/OfficeDev\/office-js-docs.ja-JP\/blob\/live\/reference\/excel\/chartcollection.md\" target=\"_blank\" title=\"ChartCollection \u30aa\u30d6\u30b8\u30a7\u30af\u30c8 (JavaScript API for Excel)\">https:\/\/github.com\/OfficeDev\/office-js-docs.ja-JP\/blob\/live\/reference\/excel\/chartcollection.md<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"\u304a\u4e45\u3057\u3076\u308a\u306eOffice \u30a2\u30c9\u30a4\u30f3\u306e\u8a18\u4e8b\u3067\u3059\u3002 \u6ce8\u76ee\u3057\u3066\u3044\u308b\u4eba\u306f\u307b\u3068\u3093\u3069\u3044\u307e\u305b\u3093\u304c\u3001Excel JavaScript API\u306e\u30ea\u30ea\u30fc\u30b9\u4e88\u5b9a\u3092\u898b\u308c\u3070\u5206\u304b\u308b\u901a\u308a\u3001Office \u30a2\u30c9\u30a4\u30f3\u306f\u5e38\u306b\u9032\u5316\u3057\u7d9a\u3051\u3066\u304a\u308a\u3001\u3067\u304d\u308b\u3053\u3068\u3082\u5c11\u3057 [&hellip;]","protected":false},"author":1,"featured_media":7119,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"[[Office\u30a2\u30c9\u30a4\u30f3]\u30c6\u30fc\u30d6\u30eb\u3084\u30b0\u30e9\u30d5\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5(Excel)]","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[130,48,79,128],"tags":[],"class_list":["post-9051","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apps-for-office","category-excel-office","category-office2013","category-office2016"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-OfficeAddins.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-2lZ","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/9051","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=9051"}],"version-history":[{"count":1,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/9051\/revisions"}],"predecessor-version":[{"id":9053,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/9051\/revisions\/9053"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7119"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9051"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9051"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9051"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}