{"id":522,"date":"2025-02-11T00:33:35","date_gmt":"2025-02-10T15:33:35","guid":{"rendered":"https:\/\/hajidai.com\/excel\/2025\/02\/%e3%80%8cexcel%e4%b8%8a%e7%b4%9a%e8%80%85%e5%bf%85%e8%a6%8b%ef%bc%81rest-api%e9%80%a3%e6%90%ba%e3%83%9e%e3%82%af%e3%83%ad%e3%81%a7%e6%a5%ad%e5%8b%99%e5%8a%b9%e7%8e%87%e5%8c%96%e3%82%92%e6%a5%b5\/"},"modified":"2025-02-11T00:33:35","modified_gmt":"2025-02-10T15:33:35","slug":"%e3%80%8cexcel%e4%b8%8a%e7%b4%9a%e8%80%85%e5%bf%85%e8%a6%8b%ef%bc%81rest-api%e9%80%a3%e6%90%ba%e3%83%9e%e3%82%af%e3%83%ad%e3%81%a7%e6%a5%ad%e5%8b%99%e5%8a%b9%e7%8e%87%e5%8c%96%e3%82%92%e6%a5%b5","status":"publish","type":"post","link":"https:\/\/hajidai.com\/excel\/2025\/02\/%e3%80%8cexcel%e4%b8%8a%e7%b4%9a%e8%80%85%e5%bf%85%e8%a6%8b%ef%bc%81rest-api%e9%80%a3%e6%90%ba%e3%83%9e%e3%82%af%e3%83%ad%e3%81%a7%e6%a5%ad%e5%8b%99%e5%8a%b9%e7%8e%87%e5%8c%96%e3%82%92%e6%a5%b5\/","title":{"rendered":"\u300cExcel\u4e0a\u7d1a\u8005\u5fc5\u898b\uff01REST API\u9023\u643a\u30de\u30af\u30ed\u3067\u696d\u52d9\u52b9\u7387\u5316\u3092\u6975\u3081\u308b5\u3064\u306e\u79d8\u8a23\u300d"},"content":{"rendered":"<h2>Excel\u4e0a\u7d1a\u8005\u306e\u305f\u3081\u306eREST API\u9023\u643a\u30de\u30af\u30ed\u306e\u958b\u767a\u624b\u6cd5<\/h2>\n<p>\u4ee5\u4e0b\u306e\u30de\u30af\u30ed\u30b3\u30fc\u30c9\u306f\u3001REST API\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3001Excel\u30b7\u30fc\u30c8\u306b\u8cbc\u308a\u4ed8\u3051\u308b\u3082\u306e\u3067\u3059\u3002\u3053\u306e\u30b3\u30fc\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u5916\u90e8\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u304b\u3089\u306e\u60c5\u5831\u53d6\u5f97\u3092\u81ea\u52d5\u5316\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>&#8220;`vba<br \/>\nSub GetDataFromAPI()<br \/>\n    Dim http As Object<br \/>\n    Dim url As String<br \/>\n    Dim response As String<\/p>\n<p>    Set http = CreateObject(&#8220;MSXML2.XMLHTTP&#8221;)<br \/>\n    url = &#8220;https:\/\/api.example.com\/data&#8221;<\/p>\n<p>    http.Open &#8220;GET&#8221;, url, False<br \/>\n    http.Send<\/p>\n<p>    response = http.responseText<\/p>\n<p>    &#8216; JSON\u30c7\u30fc\u30bf\u3092\u89e3\u6790\u3057\u3066\u30bb\u30eb\u306b\u8cbc\u308a\u4ed8\u3051\u308b\u51e6\u7406\u3092\u3053\u3053\u306b\u8ffd\u52a0<br \/>\n    &#8216; \u4f8b: Range(&#8220;A1&#8221;).Value = response<br \/>\nEnd Sub<br \/>\n&#8220;`<\/p>\n<h3>1. REST API\u3068Excel\u30de\u30af\u30ed\u306e\u9023\u643a\u306e\u91cd\u8981\u6027<\/h3>\n<p>REST API\uff08\u6ce8\uff1a\u5916\u90e8\u306e\u30b5\u30fc\u30d3\u30b9\u3084\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u3084\u308a\u53d6\u308a\u3059\u308b\u305f\u3081\u306e\u4ed5\u7d44\u307f\uff09\u3068Excel\u30de\u30af\u30ed\u3092\u9023\u643a\u3055\u305b\u308b\u3053\u3068\u306f\u3001\u30c7\u30fc\u30bf\u99c6\u52d5\u578b\u306e\u610f\u601d\u6c7a\u5b9a\u3092\u884c\u3046\u4e0a\u3067\u975e\u5e38\u306b\u91cd\u8981\u3067\u3059\u3002\u3053\u306e\u9023\u643a\u306b\u3088\u308a\u3001\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306e\u30c7\u30fc\u30bf\u53d6\u5f97\u3084\u66f4\u65b0\u304c\u53ef\u80fd\u3068\u306a\u308a\u3001\u5e38\u306b\u6700\u65b0\u306e\u60c5\u5831\u306b\u57fa\u3065\u3044\u305f\u5206\u6790\u3084\u5831\u544a\u66f8\u306e\u4f5c\u6210\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>Excel\u30de\u30af\u30ed\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001API\u547c\u3073\u51fa\u3057\u304b\u3089\u30c7\u30fc\u30bf\u306e\u6574\u5f62\u3001\u30b7\u30fc\u30c8\u3078\u306e\u8cbc\u308a\u4ed8\u3051\u307e\u3067\u3092\u81ea\u52d5\u5316\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u624b\u4f5c\u696d\u306b\u3088\u308b\u30c7\u30fc\u30bf\u5165\u529b\u30df\u30b9\u3092\u6e1b\u3089\u3057\u3001\u4f5c\u696d\u52b9\u7387\u3092\u5927\u5e45\u306b\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>2. VBA\u3092\u4f7f\u7528\u3057\u305fREST API\u9023\u643a\u306e\u5b9f\u88c5\u65b9\u6cd5<\/h3>\n<p>VBA\uff08Visual Basic for Applications\uff09\u3092\u4f7f\u7528\u3057\u3066REST API\u3068\u9023\u643a\u3059\u308b\u969b\u306f\u3001\u4e3b\u306b\u4ee5\u4e0b\u306e\u624b\u9806\u3092\u8e0f\u307f\u307e\u3059\uff1a<\/p>\n<p>1. HTTP\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u4f5c\u6210\uff1aMSXML2.XMLHTTP\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f7f\u7528\u3057\u3066HTTP\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/>\n2. API\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u306e\u6307\u5b9a\uff1a\u63a5\u7d9a\u5148\u306eURL\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n3. \u30ea\u30af\u30a8\u30b9\u30c8\u306e\u9001\u4fe1\uff1aSend\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u4fe1\u3057\u307e\u3059\u3002<br \/>\n4. \u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u53d6\u5f97\uff1aresponseText\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u4f7f\u7528\u3057\u3066API\u304b\u3089\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<br \/>\n5. \u30c7\u30fc\u30bf\u306e\u89e3\u6790\u3068\u8cbc\u308a\u4ed8\u3051\uff1aJSON\u3084XML\u306a\u3069\u306e\u5f62\u5f0f\u3067\u8fd4\u3063\u3066\u304d\u305f\u30c7\u30fc\u30bf\u3092\u89e3\u6790\u3057\u3001Excel\u30b7\u30fc\u30c8\u306b\u8cbc\u308a\u4ed8\u3051\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3089\u306e\u624b\u9806\u3092\u30de\u30af\u30ed\u5316\u3059\u308b\u3053\u3068\u3067\u3001\u30dc\u30bf\u30f3\u4e00\u3064\u3067\u30c7\u30fc\u30bf\u53d6\u5f97\u304b\u3089\u8cbc\u308a\u4ed8\u3051\u307e\u3067\u3092\u81ea\u52d5\u5316\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>3. \u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3068\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306e\u91cd\u8981\u6027<\/h3>\n<p>REST API\u9023\u643a\u30de\u30af\u30ed\u3092\u958b\u767a\u3059\u308b\u969b\u306f\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3068\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306b\u5341\u5206\u6ce8\u610f\u3092\u6255\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002API\u30ad\u30fc\u3084\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u306a\u3069\u306e\u8a8d\u8a3c\u60c5\u5831\u3092\u9069\u5207\u306b\u7ba1\u7406\u3057\u3001\u30de\u30af\u30ed\u5185\u306b\u76f4\u63a5\u8a18\u8ff0\u3057\u306a\u3044\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002\u307e\u305f\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a8\u30e9\u30fc\u3084API\u306e\u5fdc\u7b54\u30a8\u30e9\u30fc\u306a\u3069\u3001\u69d8\u3005\u306a\u30a8\u30e9\u30fc\u30b1\u30fc\u30b9\u3092\u60f3\u5b9a\u3057\u305f\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<\/p>\n<p>&#8220;`vba<br \/>\nOn Error GoTo ErrorHandler<br \/>\n&#8216; API\u30ea\u30af\u30a8\u30b9\u30c8\u3068\u30c7\u30fc\u30bf\u51e6\u7406\u306e\u30b3\u30fc\u30c9<br \/>\nExit Sub<\/p>\n<p>ErrorHandler:<br \/>\n    MsgBox &#8220;\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f: &#8221; &#038; Err.Description<br \/>\n    Exit Sub<br \/>\n&#8220;`<\/p>\n<p>\u3053\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u3067\u3001\u30de\u30af\u30ed\u306e\u5b89\u5b9a\u6027\u3068\u4fe1\u983c\u6027\u304c\u5411\u4e0a\u3057\u307e\u3059\u3002<\/p>\n<p>Excel\u30de\u30af\u30ed\u3092\u6d3b\u7528\u3057\u305fREST API\u9023\u643a\u306f\u3001\u30c7\u30fc\u30bf\u99c6\u52d5\u578b\u306e\u696d\u52d9\u30d7\u30ed\u30bb\u30b9\u3092\u69cb\u7bc9\u3059\u308b\u4e0a\u3067\u975e\u5e38\u306b\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3068\u306a\u308a\u307e\u3059\u3002\u9069\u5207\u306b\u5b9f\u88c5\u3059\u308b\u3053\u3068\u3067\u3001\u696d\u52d9\u52b9\u7387\u306e\u5927\u5e45\u306a\u5411\u4e0a\u3068\u3001\u3088\u308a\u6b63\u78ba\u3067\u8fc5\u901f\u306a\u610f\u601d\u6c7a\u5b9a\u304c\u53ef\u80fd\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Excel\u4e0a\u7d1a\u8005\u306e\u305f\u3081\u306eREST API\u9023\u643a\u30de\u30af\u30ed\u306e\u958b\u767a\u624b\u6cd5 \u4ee5\u4e0b\u306e\u30de\u30af\u30ed\u30b3\u30fc\u30c9\u306f\u3001REST API\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3001Excel\u30b7\u30fc\u30c8\u306b\u8cbc\u308a\u4ed8\u3051\u308b\u3082\u306e\u3067\u3059\u3002\u3053\u306e\u30b3\u30fc\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u5916\u90e8\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u304b\u3089\u306e\u60c5\u5831\u53d6\u5f97\u3092\u81ea<\/p>\n","protected":false},"author":2,"featured_media":521,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-522","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-advanced"],"_links":{"self":[{"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/posts\/522","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/comments?post=522"}],"version-history":[{"count":0,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/posts\/522\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/media\/521"}],"wp:attachment":[{"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/media?parent=522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/categories?post=522"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/tags?post=522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}