{"id":2340,"date":"2016-09-02T15:47:19","date_gmt":"2016-09-02T06:47:19","guid":{"rendered":"http:\/\/www23.atpages.jp\/~inoni\/?p=2340"},"modified":"2017-10-20T17:27:00","modified_gmt":"2017-10-20T08:27:00","slug":"excelvba%e8%a6%9a%e6%9b%b8-%e3%82%b3%e3%83%9e%e3%83%b3%e3%83%89%e5%ae%9f%e8%a1%8c","status":"publish","type":"post","link":"http:\/\/anada.cloudfree.jp\/?p=2340","title":{"rendered":"ExcelVBA\u899a\u66f8 \u30b3\u30de\u30f3\u30c9\u5b9f\u884c"},"content":{"rendered":"<p>Dir\u95a2\u6570\u3067\u30d5\u30a1\u30a4\u30eb\u304c\u306a\u3044\u3063\u3066\u3068\u304d\u306b\u3001<br \/>\n\u3000\u305f\u3060\u30d5\u30a1\u30a4\u30eb\u304c\u306a\u3044\u306e\u304b\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b\u3064\u306a\u304c\u3063\u3066\u306a\u3044\u306e\u304b\u308f\u304b\u3093\u306a\u3044\u306e\uff1f<br \/>\n\u3000Ping\u98db\u3070\u3057\u3066\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b\u3064\u306a\u304c\u3063\u3066\u308b\u306e\u304b\u8abf\u3079\u305f\u3089\u3044\u3044\u3058\u3083\u306a\u3044\uff1f<br \/>\n\u307f\u305f\u3044\u306a\u8981\u4ef6\u304c\u3042\u3063\u3066\u3001\u307e\u3041\u3001\u6b63\u76f4\u3001\u300c\u305d\u3053\u307e\u3067\u3084\u308b\u304b\uff1f\u300d\u3063\u3066\u601d\u3063\u305f\u3051\u3069\u3001\u305d\u3046\u3044\u3046\u74b0\u5883\u3067\u52d5\u3044\u3066\u3044\u308b\u4eba\u306f\u3001\u305d\u3046\u3044\u3046\u767a\u60f3\u306b\u306a\u308b\u3093\u3060\u308d\u3046\u306a\u3041\u30fb\u30fb\u30fb\u3068\u601d\u3063\u3066\u3001\u6559\u3048\u3066\u3082\u3089\u3063\u305fPing\u9001\u4fe1\u8853\u3092\u30a2\u30ec\u30f3\u30b8\u3057\u3066Excel\u306b\u57cb\u3081\u8fbc\u3093\u3067\u307f\u305f\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nPublic Function CheckNetwork(ip As String) As Boolean\r\n    \r\n  Dim wsh As Object\r\n  Dim buf As String\r\n    \r\n  On Error GoTo ErrCheck\r\n\r\n  Set wsh = CreateObject(&quot;WScript.Shell&quot;)\r\n  wsh.Run &quot;%ComSpec% \/c ping -n 1 &quot; &amp; ip &amp; &quot; | clip &quot;, 0, True\r\n  buf = GetObject(&quot;\\&quot; _\r\n               , &quot;htmlfile&quot;).ParentWindow.ClipboardData.GetData(&quot;text&quot;)\r\n  If InStr(buf, &quot;\u30e9\u30a6\u30f3\u30c9 \u30c8\u30ea\u30c3\u30d7\u306e\u6982\u7b97\u6642\u9593&quot;) &gt; 0 Then\r\n      CheckNetwork = True\r\n  End If\r\n  Exit Function\r\nErrCheck:\r\n  err.clear\r\nEnd Function\r\n<\/pre>\n<p>\u3061\u306a\u307f\u306b\u3001\u300c%ComSpec%\u300d\u306f\u3001\u300c%SystemRoot%\\system32\\cmd.exe\u300d\u306e\u3053\u3068\u3089\u3057\u3044\u3002<br \/>\n\u300c | clip\u300d\u3067\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u5165\u308c\u3066\u3001\u305d\u308c\u3092buf\u306b\u8aad\u307f\u8fbc\u3080\u3088\u3046\u306b\u3057\u305f\u3002<br \/>\n\u307e\u305f\u3001Shell\u306f\u3001Exec\u3067\u52d5\u304b\u3059\u65b9\u6cd5\u3068Run\u3067\u52d5\u304b\u3059\u65b9\u6cd5\u304c\u3042\u308b\u304c\u3001Run\u306e\u307b\u3046\u304c\u3001\u30b3\u30de\u30f3\u30c9\u306e\u7a93\u304c\u8868\u793a\u3055\u308c\u306a\u3044\u3088\u3046\u306b\u3067\u304d\u308b\u306e\u3067\u3001\u3053\u3061\u3089\u3092\u63a1\u7528\u3002<br \/>\n\u9762\u5012\u306a\u8981\u4ef6\u306f\u3001\u89e3\u6c7a\u3067\u304d\u308b\u3068\u5b09\u3057\u3044\u3002<br \/>\n\u89e3\u6c7a\u3057\u306a\u3044\u3068\u3001\u9006\u6068\u307f\u3057\u305d\u3046\u3060\u3051\u3069\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dir\u95a2\u6570\u3067\u30d5\u30a1\u30a4\u30eb\u304c\u306a\u3044\u3063\u3066\u3068\u304d\u306b\u3001 \u3000\u305f\u3060\u30d5\u30a1\u30a4\u30eb\u304c\u306a\u3044\u306e\u304b\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b\u3064\u306a\u304c\u3063\u3066\u306a\u3044\u306e\u304b\u308f\u304b\u3093\u306a\u3044\u306e\uff1f \u3000Ping\u98db\u3070\u3057\u3066\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b\u3064\u306a\u304c\u3063\u3066\u308b\u306e\u304b\u8abf\u3079\u305f\u3089\u3044\u3044\u3058\u3083\u306a\u3044\uff1f \u307f\u305f\u3044\u306a\u8981\u4ef6\u304c\u3042\u3063\u3066\u3001\u307e\u3041\u3001\u6b63\u76f4\u3001 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[43,74],"class_list":["post-2340","post","type-post","status-publish","format-standard","hentry","category-excelvba","tag-excel","tag-vba"],"_links":{"self":[{"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts\/2340","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2340"}],"version-history":[{"count":1,"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts\/2340\/revisions"}],"predecessor-version":[{"id":2659,"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts\/2340\/revisions\/2659"}],"wp:attachment":[{"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2340"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}