{"id":5168,"date":"2016-02-26T09:18:08","date_gmt":"2016-02-26T00:18:08","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=5168"},"modified":"2016-02-26T09:18:08","modified_gmt":"2016-02-26T00:18:08","slug":"getopenfilename","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/getopenfilename\/","title":{"rendered":"\u300c\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u300d\u30c0\u30a4\u30a2\u30ed\u30b0\u30dc\u30c3\u30af\u30b9\u3092\u8868\u793a\uff08GetOpenFilename \u30e1\u30bd\u30c3\u30c9\uff09"},"content":{"rendered":"<h2>GetOpenFilename \u30e1\u30bd\u30c3\u30c9<\/h2>\n<div class=\"m30-l\">\n<p>\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306e\u3001\u300c\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u300d\u30c0\u30a4\u30a2\u30ed\u30b0\u30dc\u30c3\u30af\u30b9\u3092\u8868\u793a\u3057\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u3053\u3053\u3067\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u5b9f\u969b\u306b\u306f\u958b\u304b\u308c\u307e\u305b\u3093\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>GetOpenFilename<\/strong> ( <em>filefilter<\/em>, <em>filterindex<\/em>, <em>title<\/em>, <em>buttontext<\/em>, <em>multiselect<\/em> )<\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h4>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5bfe\u8c61\u3068\u306a\u308b <span class=\"red\"><strong>Application \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>filefilter&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d5\u30a1\u30a4\u30eb\u306e\u7a2e\u985e\u3092\u6307\u5b9a\u3059\u308b\u6587\u5b57\u5217\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u7701\u7565\u3059\u308b\u3068\u3059\u3079\u3066\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\t\u6307\u5b9a\u65b9\u6cd5\u306f\u3001\u30c0\u30a4\u30a2\u30ed\u30b0\u30dc\u30c3\u30af\u30b9\u306b\u8868\u793a\u3059\u308b<strong>\u30d5\u30a1\u30a4\u30eb\u30d5\u30a3\u30eb\u30bf\u6587\u5b57\u5217<\/strong>\u3068<strong>\u30d5\u30a1\u30a4\u30eb\u306e\u7a2e\u985e<\/strong>\u3092\u8868\u3059<strong>\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9<\/strong>\u306e\u30da\u30a2\u3092\u30ab\u30f3\u30de\uff08,\uff09\u3067\u533a\u5207\u3063\u3066\u6307\u5b9a\u3057\u307e\u3059\u3002\u8907\u6570\u6307\u5b9a\u3057\u305f\u3044\u5834\u5408\u3082\u30ab\u30f3\u30de\uff08,\uff09\u3067\u533a\u5207\u308a\u307e\u3059\u3002\uff11\u3064\u306e<strong>\u30d5\u30a1\u30a4\u30eb\u30d5\u30a3\u30eb\u30bf\u6587\u5b57\u5217<\/strong>\u306b\u5bfe\u3057\u3066\u8907\u6570\u306e<strong>\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9<\/strong>\u3092\u6307\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u30bb\u30df\u30b3\u30ed\u30f3\uff08;\uff09\u3067\u533a\u5207\u308a\u307e\u3059\u3002<br \/>\n\t\uff08\u4f8b 1\uff09\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\uff08*.txt\uff09\u3092\u6307\u5b9a\u3059\u308b\u4f8b<br \/>\n\t\u3000\u3000&#8221;\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb,*txt&#8221;<br \/>\n\t\uff08\u4f8b 2\uff09Excel\u30d5\u30a1\u30a4\u30eb \u3092\u6307\u5b9a\u3059\u308b\u4f8b<br \/>\n\t\u3000\u3000&#8221;Excel \u30d5\u30a1\u30a4\u30eb,*.xlsx;*.xlsm&#8221;<br \/>\n\t\uff08\u4f8b 3\uff09\u3059\u3079\u3066\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a\u3059\u308b\u4f8b\uff08\u7701\u7565\u3057\u305f\u5834\u5408\u3068\u540c\u3058\uff09<br \/>\n\t\u3000\u3000&#8221;\u3059\u3079\u3066\u306e\u30d5\u30a1\u30a4\u30eb,*.*&#8221;\n      <\/li>\n<li>filterindex&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5f15\u6570 <em>filefilter<\/em> \u3067\u6307\u5b9a\u3057\u305f<strong>\u30d5\u30a1\u30a4\u30eb\u30d5\u30a3\u30eb\u30bf\u6587\u5b57\u5217<\/strong>\u306e\u4e2d\u3067\u3001\u4f55\u756a\u76ee\u306e<strong>\u30d5\u30a1\u30a4\u30eb\u30d5\u30a3\u30eb\u30bf\u6587\u5b57\u5217<\/strong>\u3092\u65e2\u5b9a\u5024\u3068\u3059\u308b\u304b\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u7701\u7565\u3059\u308b\u3068\u3001\u6700\u521d\u306e<strong>\u30d5\u30a1\u30a4\u30eb\u30d5\u30a3\u30eb\u30bf\u6587\u5b57\u5217<\/strong>\u304c\u65e2\u5b9a\u5024\u3068\u306a\u308a\u307e\u3059\u3002<\/li>\n<li>title&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30c0\u30a4\u30a2\u30ed\u30b0\u30dc\u30c3\u30af\u30b9\u306b\u8868\u793a\u3055\u308c\u308b\u30bf\u30a4\u30c8\u30eb\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u7701\u7565\u3059\u308b\u3068\u300c\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u300d\u306b\u306a\u308a\u307e\u3059\u3002<\/li>\n<li>buttontext&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;Macintosh \u3067\u306e\u307f\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002<\/li>\n<li>multiselect&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;<strong>True<\/strong> \u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u8907\u6570\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u9078\u629e\u3067\u304d\u307e\u3059\u3002<strong>False<\/strong> \u3092\u6307\u5b9a\u3059\u308b\u3068\u30011 \u3064\u306e\u30d5\u30a1\u30a4\u30eb\u3057\u304b\u9078\u629e\u3067\u304d\u307e\u305b\u3093\u3002\u65e2\u5b9a\u5024\u306f <strong>False<\/strong> \u3067\u3059\u3002<\/li>\n<\/ul><\/div>\n<br \/>\n<p class=\"caution8\"><strong>GetOpenFilename \u30e1\u30bd\u30c3\u30c9 \u306e\u623b\u308a\u5024\u306b\u3064\u3044\u3066<\/strong><br \/>\n\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u306b\u3088\u3063\u3066\u9078\u629e\u3001\u307e\u305f\u306f\u5165\u529b\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u540d\u524d\u3068\u30d1\u30b9\u540d\u3092\u8fd4\u3057\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u5f15\u6570 <em>multiselect<\/em> \u304c <strong>True<\/strong> \u306e\u5834\u5408\u306f\u3001\u914d\u5217\u304c\u8fd4\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u3068\u304d\u3001\u9078\u629e\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u304c 1 \u3064\u3067\u3082\u914d\u5217\u3068\u3057\u3066\u8fd4\u3055\u308c\u307e\u3059\u3002\u30ad\u30e3\u30f3\u30bb\u30eb\u3059\u308b\u3068 <strong>False<\/strong> \u304c\u8fd4\u3055\u308c\u307e\u3059\u3002<\/p>\n<p class=\"caution8\">\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u3001\u30ab\u30ec\u30f3\u30c8\u30c9\u30e9\u30a4\u30d6\u3084\u30ab\u30ec\u30f3\u30c8\u30d5\u30a9\u30eb\u30c0\u30fc\u304c\u5909\u66f4\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<\/div>\n<br \/><br \/>\n<h2>GetOpenFilename \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b<\/h2>\n<div class=\"m30-l\">\n<h3 id=\"vba_sample\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"GetOpenFilename \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_GetOpenFilename()\r\n\r\n    Dim FileName As Variant\r\n    \r\n    '\u300c\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u300d\u30c0\u30a4\u30a2\u30ed\u30b0\u30dc\u30c3\u30af\u30b9\u3092\u8868\u793a\uff08Excel\u30d5\u30a1\u30a4\u30eb\u3001\u8907\u6570\u9078\u629e\u53ef\uff09\r\n    FileName = Application.GetOpenFilename( _\r\n            filefilter:=\"Excel\u30d5\u30a1\u30a4\u30eb,*.xls*\", _\r\n            MultiSelect:=True)\r\n    \r\n    '\u30d5\u30a1\u30a4\u30eb\u3092\u9078\u629e\u3057\u305f\u5834\u5408\u3001\u914d\u5217\u3067\u8fd4\u3055\u308c\u308b\u306e\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\r\n    On Error GoTo MSG\r\n    \r\n    '\u30ad\u30e3\u30f3\u30bb\u30eb\u3059\u308b\u3068\u300cFalse\u300d\uff08boolean\uff09\u304c\u8fd4\u3055\u308c\u308b\u306e\u3067\r\n    'If FileName = \"False\" Then \u307e\u305f\u306f\u3001\r\n    If VarType(FileName) = vbBoolean Then\r\n        MsgBox \"\u30d5\u30a1\u30a4\u30eb\u304c\u9078\u629e\u3055\u308c\u3066\u3044\u307e\u305b\u3093\"\r\n        Exit Sub\r\n    End If\r\n    \r\nMSG:\r\n    '\u9078\u629e\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u8868\u793a\r\n    MsgBox Join(FileName, vbCrLf)\r\n\r\nEnd Sub\r\n\u3000\r\n  <\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c<\/h3>\n<p>\u4e0a\u8a18 Sample_GetOpenFilename \u3092\u5b9f\u884c<\/p>\n<p><a href=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/02\/getopenfilename01.jpg?ssl=1\" rel=\"lightbox[5168]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/02\/getopenfilename01.jpg?resize=580%2C361&#038;ssl=1\" alt=\"GetOpenFilename \u30e1\u30bd\u30c3\u30c9 01\" width=\"580\" height=\"361\" class=\"alignnone size-large wp-image-5169\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/02\/getopenfilename01.jpg?resize=580%2C361&amp;ssl=1 580w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/02\/getopenfilename01.jpg?resize=400%2C249&amp;ssl=1 400w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/02\/getopenfilename01.jpg?w=625&amp;ssl=1 625w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>5 \u3064\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u9078\u629e\u3057\u3066\u300c\u958b\u304f\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af<\/p>\n<p><a href=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/02\/getopenfilename02.jpg?ssl=1\" rel=\"lightbox[5168]\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/02\/getopenfilename02.jpg?resize=254%2C215&#038;ssl=1\" alt=\"GetOpenFilename \u30e1\u30bd\u30c3\u30c9 02\" width=\"254\" height=\"215\" class=\"alignnone size-full wp-image-5170\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n","protected":false},"excerpt":{"rendered":"<p>GetOpenFilename \u30e1\u30bd\u30c3\u30c9 \u30d5\u30a1\u30a4\u30eb\u540d\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306e\u3001\u300c\u30d5\u30a1\u30a4\u30eb &#8230; <\/p>\n","protected":false},"author":1,"featured_media":5209,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[675],"tags":[301,693,820,63,38],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/02\/getopenfilename01-580x361-1.jpg?fit=580%2C361&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-1lm","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5168"}],"collection":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/comments?post=5168"}],"version-history":[{"count":8,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5168\/revisions"}],"predecessor-version":[{"id":5208,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5168\/revisions\/5208"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/5209"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=5168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=5168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=5168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}