{"id":2206,"date":"2016-07-31T17:58:04","date_gmt":"2016-07-31T08:58:04","guid":{"rendered":"http:\/\/1bed.allright.life\/?p=2206"},"modified":"2020-04-18T21:21:42","modified_gmt":"2020-04-18T12:21:42","slug":"post-2206","status":"publish","type":"post","link":"https:\/\/1bed.allright.life\/?p=2206","title":{"rendered":"PowerShell \u3067 ClosedXML \u3092\u4f7f\u3063\u3066 Excel \u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b"},"content":{"rendered":"<h2>\u7d4c\u7def<\/h2>\n<p>\u4ee5\u524d <a href=\"http:\/\/1bed.allright.life\/?p=2095\">PowerShell \u3067 Excel \u3092\u3069\u3046\u306e\u3053\u3046\u306e\u3059\u308b\u3053\u3068\u306b\u8208\u5473\u3092\u6301\u3063\u3066\u304f\u308c\u308b\u3068\u5b09\u3057\u3044<\/a> \u3068\u3057\u3066\u30d6\u30ed\u30b0\u3092\u66f8\u3044\u305f\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u6642\u306e\u65b9\u6cd5\u3067\u306f\u3001 Excel \u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3057\u305f\u304c\u3001ClosedXML \u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3046\u3068 Excel \u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u306a\u304f\u3066\u3082 Excel \u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308c\u308b\u3053\u3068\u3092\u77e5\u308a\u307e\u3057\u305f\u306e\u3067\u3001\u5c11\u3057\u8a66\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h2>\u74b0\u5883<\/h2>\n<ul>\n<li>Windows 10<\/li>\n<li>PowerShell 5.0<\/li>\n<li>ClosedXML 0.76.0<\/li>\n<li>Microsoft Open XML Format SDK<\/li>\n<\/ul>\n<h2>\u4f5c\u696d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/h2>\n<p>\u4f5c\u696d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u306b\u4f5c\u308a\u307e\u3057\u305f\u3002<\/p>\n<h2>ClosedXML \u306e\u6e96\u5099<\/h2>\n<p>\u307e\u305a\u306f\u30b5\u30a4\u30c8\u3067\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002 zip \u5f62\u5f0f\u3067\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/closedxml.codeplex.com\/\">ClosedXML &#8211; The easy way to OpenXML<\/a><\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/07\/01.png\" alt=\"\" \/><\/p>\n<p>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u306f\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u89b3\u70b9\u304b\u3089\u30d6\u30ed\u30c3\u30af\u304c\u65bd\u3055\u308c\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u89e3\u9664\u3092\u3057\u3066\u89e3\u51cd\u3057\u307e\u3059\u3002<\/p>\n<p>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f zip \u30d5\u30a1\u30a4\u30eb\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u3066\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u958b\u304d\u3001\u30d6\u30ed\u30c3\u30af\u306e\u89e3\u9664\u306b\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u3066 OK \u30dc\u30bf\u30f3\u3092\u62bc\u3057\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/07\/02.png\" alt=\"\" \/><\/p>\n<p>\u305d\u306e\u5f8c\u3001zip \u30d5\u30a1\u30a4\u30eb\u304b\u3089 ClosedXML.dll \u3092\u53d6\u5f97\u3057\u3066\u3001\u4f5c\u696d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u4fdd\u5b58\u3057\u307e\u3059\u3002<\/p>\n<h2>Microsoft Open XML Format SDK \u306e\u6e96\u5099<\/h2>\n<p><a href=\"https:\/\/closedxml.codeplex.com\/documentation\">ClosedXML \u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30da\u30fc\u30b8<\/a> \u304b\u3089\u3082 DLL \u3092\u76f4\u63a5\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u304c\u3001\u4eca\u56de\u306f<br \/>\nMicrosoft \u306e\u30b5\u30a4\u30c8\u304b\u3089 Microsoft Open XML Format SDK \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/www.microsoft.com\/ja-JP\/download\/details.aspx?id=5124\">Open XML SDK 2.0 for Microsoft Office<\/a><\/li>\n<li><a href=\"https:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=30425\">Open XML SDK 2.5 for Microsoft Office<\/a><\/li>\n<\/ul>\n<p>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u30da\u30fc\u30b8\u306e\u4f8b<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/07\/03.png\" alt=\"\" \/><\/p>\n<p>\u4eca\u56de\u79c1\u306f 2.0 \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u307f\u307e\u3057\u305f\u304c\u3001\u79c1\u306e\u74b0\u5883\u3067\u306f\u3001msi \u3092\u5b9f\u884c\u3059\u308b\u3068\u3001 C:\\Program Files (x86)\\Open XML SDK\\V2.0\\lib \u306b\u914d\u7f6e\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>Office \u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u95a2\u4fc2\u304c\u3042\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>MS Office<\/th>\n<th>Open XML Format SDK<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Office 2007<\/td>\n<td>SDK 1.0<\/td>\n<\/tr>\n<tr>\n<td>Office 2010<\/td>\n<td>SDK 2.0<\/td>\n<\/tr>\n<tr>\n<td>Office 2013 \u4ee5\u964d<\/td>\n<td>SDK 2.5<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>ClosedXML \u516c\u5f0f\u3067\u914d\u5e03\u3055\u308c\u3066\u3044\u305f\u306e\u306f\u30012.0 \u3068 2.5 \u3067\u3057\u305f\u3002<\/p>\n<h2>Hello world<\/h2>\n<p>\u65e9\u901f Hello world \u3092\u66f8\u3044\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-powershell\">[Reflection.Assembly]::LoadFile(&quot;$PSScriptRoot\\ClosedXML.dll&quot;)\n[Reflection.Assembly]::LoadFile(&quot;C:\\Program Files (x86)\\Open XML SDK\\V2.0\\lib\\DocumentFormat.OpenXml.dll&quot;)\n\n$workBook = new-object ClosedXML.Excel.XLWorkbook\n$workSheet = $workBook.Worksheets.Add(&quot;Sheet1&quot;)   \n$worksheet.Cell(&quot;A1&quot;).Value = &quot;Hello world&quot;;\n$workBook.SaveAs(&quot;$PSScriptRoot\\helloworld.xlsx&quot;)<\/code><\/pre>\n<p>\u7d50\u679c\u306f\u3053\u3046\u306a\u308a\u307e\u3057\u305f<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/07\/04.png\" alt=\"\" \/><\/p>\n<h2>\u8003\u5bdf<\/h2>\n<p>\u3068\u3066\u3082\u7c21\u5358\u3067\u3057\u305f\u3057\u3001\u52d5\u4f5c\u304c\u3068\u3066\u3082\u8efd\u5feb\u3067\u9a5a\u304d\u307e\u3057\u305f\u3002\u4ee5\u524d\u306e\u65b9\u6cd5\u3060\u3068\u3001\u4f55\u3089\u304b\u306e\u7406\u7531\u3067 COM \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u7834\u68c4\u304c\u3067\u304d\u306a\u304b\u3063\u305f\u6642\u306f\u3001Excel \u306e\u30d7\u30ed\u30bb\u30b9\u304c\u6b8b\u3063\u3066\u3057\u307e\u3046\u3068\u3044\u3046\u4e8b\u304c\u3042\u308a\u307e\u3057\u305f\u304c\u3001\u305d\u306e\u5371\u967a\u6027\u3082\u306a\u3055\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u6c17\u304c\u3064\u3044\u305f\u30e1\u30ea\u30c3\u30c8\u30fb\u30c7\u30e1\u30ea\u30c3\u30c8\u306f\u4e0b\u8a18\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<h3>\u30e1\u30ea\u30c3\u30c8<\/h3>\n<ul>\n<li>\u52d5\u4f5c\u304c\u8efd\u5feb<\/li>\n<li>Excel \u304c\u5165\u3063\u3066\u3044\u306a\u3044\u30de\u30b7\u30f3\u3067\u3082\u5b9f\u884c\u3067\u304d\u308b <strong>\u91cd\u8981<\/strong><\/li>\n<li>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u7834\u68c4\u306b\u6c17\u3092\u914d\u308b\u5fc5\u8981\u304c\u306a\u3044<\/li>\n<\/ul>\n<h3>\u30c7\u30e1\u30ea\u30c3\u30c8<\/h3>\n<ul>\n<li>xls \u5f62\u5f0f\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u6271\u3048\u306a\u3044<\/li>\n<li>\u74b0\u5883\u69cb\u7bc9\u304c Excel \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3060\u3051\u306b\u6bd4\u3079\u308b\u3068\u7169\u96d1<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u7d4c\u7def \u4ee5\u524d PowerShell \u3067 Excel \u3092\u3069\u3046\u306e\u3053\u3046\u306e\u3059\u308b\u3053\u3068\u306b\u8208\u5473\u3092\u6301\u3063\u3066\u304f\u308c\u308b\u3068\u5b09\u3057\u3044 \u3068\u3057\u3066\u30d6\u30ed\u30b0\u3092\u66f8\u3044\u305f\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002 \u305d\u306e\u6642\u306e\u65b9\u6cd5\u3067\u306f\u3001 Excel \u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3057\u305f\u304c\u3001Cl [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[98,97,62],"class_list":["post-2206","post","type-post","status-publish","format-standard","hentry","category-program","tag-closedxml","tag-excel","tag-powershell"],"_links":{"self":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/2206","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2206"}],"version-history":[{"count":5,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/2206\/revisions"}],"predecessor-version":[{"id":3150,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/2206\/revisions\/3150"}],"wp:attachment":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2206"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2206"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}