{"id":5264,"date":"2015-02-18T13:56:38","date_gmt":"2015-02-18T04:56:38","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=5264"},"modified":"2015-02-18T13:56:38","modified_gmt":"2015-02-18T04:56:38","slug":"%e3%83%89%e3%83%a9%e3%83%83%e3%82%b0%ef%bc%86%e3%83%89%e3%83%ad%e3%83%83%e3%83%97%e3%81%a7excel%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%82%92%e3%82%a2%e3%83%89%e3%82%a4%e3%83%b3%e5%bd%a2%e5%bc%8fxlam","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=5264","title":{"rendered":"\u30c9\u30e9\u30c3\u30b0\uff06\u30c9\u30ed\u30c3\u30d7\u3067Excel\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c9\u30a4\u30f3\u5f62\u5f0f(xlam)\u306b\u4e00\u62ec\u5909\u63db\u3059\u308bVBScript"},"content":{"rendered":"<p>\u8907\u6570\u306eExcel\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c9\u30a4\u30f3\u5f62\u5f0f(xlam)\u306b\u5909\u63db\u3059\u308b\u5fc5\u8981\u304c\u3042\u3063\u305f\u306e\u3067\u3001<a href=\"\/\/www.ka-net.org\/blog\/?p=3828\" title=\"Office\u6587\u66f8\u3092\u65e7\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u30d5\u30a1\u30a4\u30eb\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308bVBScript | \u521d\u5fc3\u8005\u5099\u5fd8\u9332\" target=\"_blank\">\u4ee5\u524d\u66f8\u3044\u305f\u8a18\u4e8b<\/a>\u3092\u6d41\u7528\u3057\u3066\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3044\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nDim Fso\r\nDim Args\r\nDim OutputFilePath\r\nDim i\r\n\r\nConst xlOpenXMLAddIn = 55\r\n\r\nSet Fso = CreateObject(&quot;Scripting.FileSystemObject&quot;)\r\nSet Args = WScript.Arguments\r\nIf Args.Count &lt; 1 Then\r\n  MsgBox &quot;\u30a2\u30c9\u30a4\u30f3\u5f62\u5f0f(xlam)\u306b\u5909\u63db\u3057\u305f\u3044Excel\u30d5\u30a1\u30a4\u30eb\u3092\u5f53\u30b9\u30af\u30ea\u30d7\u30c8\u30d5\u30a1\u30a4\u30eb\u306b\u30c9\u30e9\u30c3\u30b0\uff06\u30c9\u30ed\u30c3\u30d7\u3057\u3066\u304f\u3060\u3055\u3044\u3002&quot;, vbExclamation + vbSystemModal\r\n  WScript.Quit\r\nEnd If\r\n\r\n'\u30c9\u30ed\u30c3\u30d7\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u51e6\u7406(\u8907\u6570\u30d5\u30a1\u30a4\u30eb\u5bfe\u5fdc)\r\nOn Error Resume Next\r\nFor i = 0 To Args.Count - 1\r\n  Select Case LCase(Fso.GetExtensionName(Args(i)))\r\n    Case &quot;xls&quot;, &quot;xlsx&quot;, &quot;xlsm&quot;\r\n      OutputFilePath = Fso.GetParentFolderName(Args(i)) &amp; ChrW(92) &amp; Fso.GetBaseName(Args(i)) &amp; &quot;.xlam&quot;\r\n      With CreateObject(&quot;Excel.Application&quot;)\r\n        .Visible = True\r\n        .DisplayAlerts = False\r\n        With .Workbooks.Open(Args(i))\r\n          .SaveAs OutputFilePath, xlOpenXMLAddIn\r\n          .Close False\r\n        End With\r\n        .DisplayAlerts = True\r\n        .Quit\r\n      End With\r\n  End Select\r\n  WScript.Sleep 500 '\u51e6\u7406\u5f85\u3061\r\nNext\r\nOn Error GoTo 0\r\n\r\nMsgBox &quot;\u51e6\u7406\u304c\u7d42\u4e86\u3057\u307e\u3057\u305f\u3002&quot;<\/pre>\n<p>\u4f7f\u3046\u5834\u9762\u306f\u9650\u3089\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u4e00\u3005\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u540d\u524d\u3092\u4ed8\u3051\u3066\u4fdd\u5b58\u3057\u3066\u30fb\u30fb\u30fb\u3068\u3044\u3046\u624b\u9593\u306f\u639b\u304b\u3089\u306a\u3044\u306e\u3067\u3001Excel\u30d5\u30a1\u30a4\u30eb\u3092xlam\u30d5\u30a1\u30a4\u30eb\u306b\u4e00\u62ec\u5909\u63db\u3057\u305f\u3044\u3068\u304d\u306b\u306f\u304a\u85a6\u3081\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3059\u3002<\/p>\n<h4>\u25a0 \u95a2\u9023\u8a18\u4e8b<\/h4>\n<p><strong>\u30fb\u53e4\u3044\u5f62\u5f0f\u306eWord\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u65b0\u3057\u3044\u5f62\u5f0f\u306b\u4e00\u62ec\u5909\u63db\u3059\u308bVBScript<\/strong><br \/>\n<a href=\"\/\/www.ka-net.org\/blog\/?p=3427\" title=\"\u53e4\u3044\u5f62\u5f0f\u306eWord\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u65b0\u3057\u3044\u5f62\u5f0f\u306b\u4e00\u62ec\u5909\u63db\u3059\u308bVBScript | \u521d\u5fc3\u8005\u5099\u5fd8\u9332\" target=\"_blank\">\/\/www.ka-net.org\/blog\/?p=3427<\/a><br \/>\n<strong>\u30fbOffice\u6587\u66f8\u3092\u65e7\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u30d5\u30a1\u30a4\u30eb\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308bVBScript<\/strong><br \/>\n<a href=\"\/\/www.ka-net.org\/blog\/?p=3828\" title=\"Office\u6587\u66f8\u3092\u65e7\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u30d5\u30a1\u30a4\u30eb\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308bVBScript | \u521d\u5fc3\u8005\u5099\u5fd8\u9332\" target=\"_blank\">\/\/www.ka-net.org\/blog\/?p=3828<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\u8907\u6570\u306eExcel\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c9\u30a4\u30f3\u5f62\u5f0f(xlam)\u306b\u5909\u63db\u3059\u308b\u5fc5\u8981\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u4ee5\u524d\u66f8\u3044\u305f\u8a18\u4e8b\u3092\u6d41\u7528\u3057\u3066\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3044\u3066\u307f\u307e\u3057\u305f\u3002 Option Explicit Dim Fso Dim Args Dim OutputF [&hellip;]","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":"\u8ab0\u5f97\uff1f\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3059\u3002 [\u30c9\u30e9\u30c3\u30b0\uff06\u30c9\u30ed\u30c3\u30d7\u3067Excel\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c9\u30a4\u30f3\u5f62\u5f0f(xlam)\u306b\u4e00\u62ec\u5909\u63db\u3059\u308bVBScript]","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":[4,48,6],"tags":[],"class_list":["post-5264","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-excel-office","category-vbs"],"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-1mU","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5264","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=5264"}],"version-history":[{"count":1,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5264\/revisions"}],"predecessor-version":[{"id":5265,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5264\/revisions\/5265"}],"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=5264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}