{"id":5141,"date":"2014-12-26T14:15:41","date_gmt":"2014-12-26T05:15:41","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=5141"},"modified":"2014-12-26T14:15:41","modified_gmt":"2014-12-26T05:15:41","slug":"%e3%82%a2%e3%83%89%e3%82%a4%e3%83%b3%e3%82%84%e3%83%86%e3%83%b3%e3%83%97%e3%83%ac%e3%83%bc%e3%83%88%e3%81%ae%e3%83%90%e3%83%bc%e3%82%b8%e3%83%a7%e3%83%b3%e3%83%81%e3%82%a7%e3%83%83%e3%82%af%e3%82%92","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=5141","title":{"rendered":"\u30a2\u30c9\u30a4\u30f3\u3084\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046VBA\u30de\u30af\u30ed"},"content":{"rendered":"<p>\u8272\u3005\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u5b9f\u88c5\u3055\u308c\u3066\u3044\u308b\u3001\u300c<span style=\"color: #ff0000; font-weight: bold;\">\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u78ba\u8a8d<\/span>\u300d\u6a5f\u80fd\u3001VBA\u30de\u30af\u30ed\u306e\u30a2\u30c9\u30a4\u30f3\u3084\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3067\u306f\u3069\u306e\u3088\u3046\u306b\u5b9f\u88c5\u3057\u305f\u3089\u3088\u3044\u306e\u304b\u3001\u7c21\u5358\u306a\u51e6\u7406\u3092\u8003\u3048\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/ChkVersion_01.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/ChkVersion_01.jpg\" alt=\"ChkVersion_01\" width=\"300\" height=\"99\" class=\"alignnone size-full wp-image-5142\" \/><\/a><\/p>\n<p>\u8272\u3005\u306a\u65b9\u6cd5\u304c\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u307e\u305a\u601d\u3044\u3064\u3044\u305f\u306e\u306fXML\u3092\u4f7f\u3046\u65b9\u6cd5\u3002<\/p>\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306aXML\u3092\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u4e0a\u306e\u9069\u5f53\u306a\u5834\u6240\u306b\u4fdd\u5b58(\u4e0b\u8a18\u4f8b\u3067\u306f<span style=\"color: #ff0000; font-weight: bold;\">http:\/\/localhost\/update.xml<\/span>)\u3057\u3066\u304a\u3044\u3066\u3001\u30de\u30af\u30ed\u304b\u3089\u305d\u306eXML\u3092\u8aad\u307f\u8fbc\u307f\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u6bd4\u8f03\u3092\u884c\u3046\u3001\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002<\/p>\n<h4>\u25a0 update.xml(UTF-8 BOM\u7121\u3057)<\/h4>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\r\n&lt;update&gt;\r\n  &lt;apps&gt;\r\n    &lt;app id=&quot;AP001&quot;&gt;\r\n      &lt;version&gt;1.0.1&lt;\/version&gt;\r\n      &lt;url&gt;http:\/\/localhost\/apps\/AP001.html&lt;\/url&gt;\r\n    &lt;\/app&gt;\r\n  &lt;\/apps&gt;\r\n&lt;\/update&gt;<\/pre>\n<h4>\u25a0 \u6a19\u6e96\u30e2\u30b8\u30e5\u30fc\u30eb<\/h4>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nPrivate Const AppID As String = &quot;AP001&quot; '\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u8b58\u5225\u7528\u306eID\r\nPrivate Const AppVer As String = &quot;1.0.0&quot; '\u73fe\u30d0\u30fc\u30b8\u30e7\u30f3\r\nPrivate Const ChkXmlUrl As String = &quot;http:\/\/localhost\/update.xml&quot; '\u30d0\u30fc\u30b8\u30e7\u30f3\u30c1\u30a7\u30c3\u30af\u7528XML\r\n\r\nPrivate Sub ChkVersion()\r\n'\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30c1\u30a7\u30c3\u30af\r\n  Dim xml As String\r\n  Dim ver As String\r\n  Dim url As String\r\n  \r\n  xml = &quot;&quot;: ver = &quot;&quot;: url = &quot;&quot; '\u521d\u671f\u5316\r\n  With CreateObject(&quot;WinHttp.WinHttpRequest.5.1&quot;)\r\n    .Open &quot;GET&quot;, ChkXmlUrl, False\r\n    .SetRequestHeader &quot;Content-Type&quot;, &quot;application\/xml; charset=UTF-8&quot;\r\n    .Send\r\n    Select Case .Status\r\n      Case 200: xml = .ResponseText\r\n      Case Else: GoTo Err\r\n    End Select\r\n  End With\r\n  If Len(Trim(xml)) &lt; 1 Then GoTo Err\r\n  \r\n  With CreateObject(&quot;MSXML2.DOMDocument&quot;)\r\n    .async = False\r\n    If .LoadXML(xml) = True Then\r\n      With .SelectNodes(&quot;\/update\/apps\/app&#x5B;@id='&quot; &amp; AppID &amp; &quot;']&quot;)\r\n        If .Length &gt; 0 Then\r\n          On Error GoTo Err\r\n          ver = .Item(0).SelectSingleNode(&quot;version&quot;).Text\r\n          On Error GoTo 0\r\n          If Len(Trim(ver)) &gt; 0 Then\r\n            If VerToNum(AppVer) &lt; VerToNum(ver) Then\r\n              Select Case MsgBox(&quot;\u73fe\u5728\u304a\u4f7f\u3044\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002&quot; &amp; vbCrLf &amp; _\r\n                                 &quot;\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3 &#x5B;&quot; &amp; ver &amp; &quot;] \u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u30da\u30fc\u30b8\u3092\u8868\u793a\u3057\u307e\u3059\u304b\uff1f&quot;, _\r\n                                 vbQuestion + vbYesNo + vbSystemModal)\r\n                Case vbYes\r\n                  On Error GoTo Err\r\n                  url = .Item(0).SelectSingleNode(&quot;url&quot;).Text\r\n                  On Error GoTo 0\r\n                  If Len(Trim(url)) &gt; 0 Then\r\n                    With CreateObject(&quot;InternetExplorer.Application&quot;)\r\n                      .Visible = True\r\n                      .Navigate url\r\n                    End With\r\n                  Else\r\n                    GoTo Err\r\n                  End If\r\n                  Exit Sub\r\n              End Select\r\n              Exit Sub\r\n            Else\r\n              MsgBox &quot;\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002&quot;, vbInformation + vbSystemModal\r\n              Exit Sub\r\n            End If\r\n          Else\r\n            GoTo Err\r\n          End If\r\n        Else\r\n          GoTo Err\r\n        End If\r\n      End With\r\n    Else\r\n      GoTo Err\r\n    End If\r\n  End With\r\n  \r\n  Exit Sub\r\nErr:\r\n  MsgBox &quot;\u30d0\u30fc\u30b8\u30e7\u30f3\u30c1\u30a7\u30c3\u30af\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002&quot; &amp; vbCrLf &amp; _\r\n         &quot;\u51e6\u7406\u3092\u4e2d\u6b62\u3057\u307e\u3059\u3002&quot;, vbCritical + vbSystemModal\r\nEnd Sub\r\n\r\nPrivate Function VerToNum(ByVal ver As String) As Long\r\n'\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u756a\u53f7\u306b\u5165\u3063\u3066\u3044\u308b&#x5B;.]\u3092\u524a\u9664\r\n  VerToNum = CLng(Replace(ver, &quot;.&quot;, &quot;&quot;))\r\nEnd Function<\/pre>\n<p>\u4e0a\u8a18\u30de\u30af\u30ed\u306f\u3001\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u4e0a\u306eXML\u304b\u3089\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u756a\u53f7\u3092\u8aad\u307f\u53d6\u308a\u3001\u5b9a\u6570\u3068\u3057\u3066\u4fdd\u6301\u3057\u3066\u3044\u305f\u756a\u53f7\u3088\u308a\u65b0\u3057\u3051\u308c\u3070\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u30da\u30fc\u30b8\u3092\u958b\u304f\u3068\u3044\u3046\u3001\u975e\u5e38\u306b\u30b7\u30f3\u30d7\u30eb\u306a\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>XML\u3092\u4e0b\u8a18\u306e\u3088\u3046\u306b\u3059\u308c\u3070\u3001\u8907\u6570\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u4e00\u3064\u306e\u30d5\u30a1\u30a4\u30eb\u3067\u7ba1\u7406\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\r\n&lt;update&gt;\r\n  &lt;apps&gt;\r\n    &lt;app id=&quot;AP001&quot;&gt;\r\n      &lt;version&gt;1.0.1&lt;\/version&gt;\r\n      &lt;url&gt;http:\/\/localhost\/apps\/AP001.html&lt;\/url&gt;\r\n    &lt;\/app&gt;\r\n    &lt;app id=&quot;AP002&quot;&gt;\r\n      &lt;version&gt;2.0.0&lt;\/version&gt;\r\n      &lt;url&gt;http:\/\/localhost\/apps\/AP002.html&lt;\/url&gt;\r\n    &lt;\/app&gt;\r\n    &lt;app id=&quot;AP003&quot;&gt;\r\n      &lt;version&gt;0.0.5&lt;\/version&gt;\r\n      &lt;url&gt;http:\/\/localhost\/apps\/AP003.html&lt;\/url&gt;\r\n    &lt;\/app&gt;\r\n  &lt;\/apps&gt;\r\n&lt;\/update&gt;<\/pre>\n<p>\u307e\u305f\u3001\u4e0a\u8a18XML\u3067\u306f\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u30da\u30fc\u30b8\u306eURL\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u5148\u3092\u76f4\u63a5\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u30de\u30af\u30ed\u304b\u3089\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u308b\u3067\u3057\u3087\u3046(\u300c<a href=\"\/\/www.ka-net.org\/blog\/?p=4855\" title=\"VBA\u3067\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u4e0a\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u65b9\u6cd5\u3092\u307e\u3068\u3081\u3066\u307f\u307e\u3057\u305f\u3002\" target=\"_blank\">VBA\u3067\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u4e0a\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u65b9\u6cd5\u3092\u307e\u3068\u3081\u3066\u307f\u307e\u3057\u305f\u3002<\/a>\u300d\u53c2\u7167)\u3002<\/p>\n<p>\u3053\u306e\u3042\u305f\u308a\u306e\u7d30\u304b\u3044\u52d5\u4f5c\u306f\u3001\u81ea\u5206\u306e\u597d\u307f\u3067\u5b9f\u88c5\u3059\u308c\u3070\u826f\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8272\u3005\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u5b9f\u88c5\u3055\u308c\u3066\u3044\u308b\u3001\u300c\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u78ba\u8a8d\u300d\u6a5f\u80fd\u3001VBA\u30de\u30af\u30ed\u306e\u30a2\u30c9\u30a4\u30f3\u3084\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3067\u306f\u3069\u306e\u3088\u3046\u306b\u5b9f\u88c5\u3057\u305f\u3089\u3088\u3044\u306e\u304b\u3001\u7c21\u5358\u306a\u51e6\u7406\u3092\u8003\u3048\u3066\u307f\u307e\u3057\u305f\u3002 \u8272\u3005\u306a\u65b9\u6cd5\u304c\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u307e\u305a\u601d\u3044\u3064\u3044\u305f\u306e\u306fX [&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":"\u81ea\u4f5c\u30a2\u30c9\u30a4\u30f3\u3092\u516c\u958b\u3057\u3066\u3044\u308b\u4eba\u306b\u306f\u5f79\u7acb\u3064\u304b\u3082\uff1f [\u30a2\u30c9\u30a4\u30f3\u3084\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046VBA\u30de\u30af\u30ed]","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,49,58],"tags":[],"class_list":["post-5141","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-excel-office","category-word-office","category-powerpoint"],"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-1kV","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5141","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=5141"}],"version-history":[{"count":1,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5141\/revisions"}],"predecessor-version":[{"id":5143,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5141\/revisions\/5143"}],"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=5141"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5141"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5141"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}