{"id":73,"date":"2023-07-10T09:10:09","date_gmt":"2023-07-10T00:10:09","guid":{"rendered":"https:\/\/rafa-system.com\/vba\/?p=73"},"modified":"2023-07-10T09:12:18","modified_gmt":"2023-07-10T00:12:18","slug":"post-73","status":"publish","type":"post","link":"https:\/\/rafa-system.com\/vba\/2023\/07\/10\/post-73\/","title":{"rendered":"\u4ed6\u306e\u30d6\u30c3\u30af\u3092\u958b\u304f"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u5358\u4e00\u3067\u958b\u304f\u5834\u5408<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u30d6\u30c3\u30af\u3092\u958b\u304f<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>Workbooks.Open(\u30d5\u30a1\u30a4\u30eb\u306e\u30d5\u30eb\u30d1\u30b9)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u30c0\u30a4\u30a2\u30ed\u30b0\u306e\u8868\u793a<\/h3>\n\n\n\n<p>return:\u6587\u5b57\u5217\u578b\uff08\u30d5\u30a1\u30a4\u30eb\u306e\u30d5\u30eb\u30d1\u30b9\/\u30ad\u30e3\u30f3\u30bb\u30eb\u6642\u306f\u6587\u5b57\u578b\u3067&#8221;False&#8221;\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>path = Application.GetOpenFilename(\"Microsoft Excel \u30d6\u30c3\u30af, *.xls?\")<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u30ad\u30e3\u30f3\u30bb\u30eb\u5bfe\u7b56\uff0b\u958b\u3044\u305f\u30d6\u30c3\u30af\u3092\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u5909\u6570\u306b\u30bb\u30c3\u30c8<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>if not filepath = \"False\" then\nDim wb As Workbook: Set wb = Workbooks.Open(path)\nend if<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u958b\u3044\u305f\u30d6\u30c3\u30af\u3092\u9589\u3058\u308b<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>wb.Close<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u8907\u6570\u9078\u629e\u53ef\u80fd\u306b\u3059\u308b<\/h2>\n\n\n\n<p>GetOpenFilename\u306e\u5f15\u6570\u306b\u300cMultiSelect:=True\u300d\u3092\u8ffd\u52a0<br>return:1\u30d9\u30fc\u30b9\u306e\u4e00\u6b21\u5143\u914d\u5217\uff08\u30ad\u30e3\u30f3\u30bb\u30eb\u6642\u306fBoolean\u578b\u306eFalse\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>arr_path = Application.GetOpenFilename(\"Microsoft Excel \u30d6\u30c3\u30af, *.xls?\", MultiSelect:=True)<\/code><\/pre>\n\n\n\n<p>IsArray()\u95a2\u6570\u3067\u30ad\u30e3\u30f3\u30bb\u30eb\u3055\u308c\u3066\u306a\u3044\u304b\u5224\u5b9a\u53ef\u80fd<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if not IsArray(arr_path) then\n\tmsgBox \"\u30ad\u30e3\u30f3\u30bb\u30eb\u3055\u308c\u307e\u3057\u305f\"\nend if<\/code><\/pre>\n\n\n\n<p>\u8907\u6570\u306e\u30d6\u30c3\u30af\u3092\u30eb\u30fc\u30d7\u51e6\u7406\u3059\u308b\uff08ScreenUpdating\u3067\u30c1\u30e9\u30c4\u30ad\u9632\u6b62\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if IsArray(arr_path) then\n\tApplication.ScreenUpdating = False\n\n\tfor i = 1 to ubound(arr_path)\n\t\tset wb = Workbooks.Open(arr_path(i))\n\t\t\uff5e\u51e6\u7406\uff5e\n\t\twb.Close\n\tnext i\n\n\tApplication.ScreenUpdating = True\nend if<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5358\u4e00\u3067\u958b\u304f\u5834\u5408 \u30d6\u30c3\u30af\u3092\u958b\u304f \u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u30c0\u30a4\u30a2\u30ed\u30b0\u306e\u8868\u793a return:\u6587\u5b57\u5217\u578b\uff08\u30d5\u30a1\u30a4\u30eb\u306e\u30d5\u30eb\u30d1\u30b9\/\u30ad\u30e3\u30f3\u30bb\u30eb\u6642\u306f\u6587\u5b57\u578b\u3067&#8221;False&#8221;\uff09 \u30ad\u30e3\u30f3\u30bb\u30eb\u5bfe\u7b56\uff0b\u958b\u3044\u305f\u30d6\u30c3\u30af\u3092\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u5909\u6570\u306b\u30bb [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[4],"class_list":["post-73","post","type-post","status-publish","format-standard","hentry","category-11","tag-4"],"_links":{"self":[{"href":"https:\/\/rafa-system.com\/vba\/wp-json\/wp\/v2\/posts\/73","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rafa-system.com\/vba\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rafa-system.com\/vba\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rafa-system.com\/vba\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rafa-system.com\/vba\/wp-json\/wp\/v2\/comments?post=73"}],"version-history":[{"count":5,"href":"https:\/\/rafa-system.com\/vba\/wp-json\/wp\/v2\/posts\/73\/revisions"}],"predecessor-version":[{"id":80,"href":"https:\/\/rafa-system.com\/vba\/wp-json\/wp\/v2\/posts\/73\/revisions\/80"}],"wp:attachment":[{"href":"https:\/\/rafa-system.com\/vba\/wp-json\/wp\/v2\/media?parent=73"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rafa-system.com\/vba\/wp-json\/wp\/v2\/categories?post=73"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rafa-system.com\/vba\/wp-json\/wp\/v2\/tags?post=73"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}