{"id":131602,"date":"2024-03-25T19:43:48","date_gmt":"2024-03-25T10:43:48","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/excel-%e3%81%a7%e9%85%8d%e5%88%97%e3%81%ab%e5%80%a4%e3%82%92%e8%a8%ad%e5%ae%9a%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/"},"modified":"2024-03-28T15:18:35","modified_gmt":"2024-03-28T06:18:35","slug":"excel-%e3%81%a7%e9%85%8d%e5%88%97%e3%81%ab%e5%80%a4%e3%82%92%e8%a8%ad%e5%ae%9a%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/excel-%e3%81%a7%e9%85%8d%e5%88%97%e3%81%ab%e5%80%a4%e3%82%92%e8%a8%ad%e5%ae%9a%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/","title":{"rendered":"Excel \u3067\u914d\u5217\u306b\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u6b21\u306e\u30b3\u30fc\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001Excel \u306e\u8868\u306e\u30c7\u30fc\u30bf\u3092\u914d\u5217\u306b\u5272\u308a\u5f53\u3066\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"hljs-keyword\">Dim<\/span> xlApp <span class=\"hljs-keyword\">As<\/span> <span class=\"hljs-type\">Object<\/span>\r\n<span class=\"hljs-keyword\">Dim<\/span> xlWorkbook <span class=\"hljs-keyword\">As<\/span> <span class=\"hljs-type\">Object<\/span>\r\n<span class=\"hljs-keyword\">Dim<\/span> xlWorksheet <span class=\"hljs-keyword\">As<\/span> <span class=\"hljs-type\">Object<\/span>\r\n<span class=\"hljs-keyword\">Dim<\/span> arrData <span class=\"hljs-keyword\">As<\/span> Variant\r\n<span class=\"hljs-keyword\">Dim<\/span> i <span class=\"hljs-keyword\">As<\/span> <span class=\"hljs-type\">Long<\/span>\r\n<span class=\"hljs-keyword\">Dim<\/span> numRows <span class=\"hljs-keyword\">As<\/span> <span class=\"hljs-type\">Long<\/span>\r\n<span class=\"hljs-comment\">' \u521b\u5efaExcel\u5bf9\u8c61<\/span>\r\n<span class=\"hljs-keyword\">Set<\/span> xlApp = CreateObject(<span class=\"hljs-string\">\"Excel.Application\"<\/span>)\r\n<span class=\"hljs-comment\">' \u6253\u5f00Excel\u6587\u4ef6<\/span>\r\n<span class=\"hljs-keyword\">Set<\/span> xlWorkbook = xlApp.Workbooks.Open(<span class=\"hljs-string\">\"C:\\path\\to\\excel_file.xlsx\"<\/span>)\r\n<span class=\"hljs-comment\">' \u9009\u62e9\u5de5\u4f5c\u8868<\/span>\r\n<span class=\"hljs-keyword\">Set<\/span> xlWorksheet = xlWorkbook.Sheets(<span class=\"hljs-string\">\"Sheet1\"<\/span>)\r\n<span class=\"hljs-comment\">' \u83b7\u53d6\u6570\u636e\u8303\u56f4\u7684\u884c\u6570\u548c\u5217\u6570<\/span>\r\nnumRows = xlWorksheet.UsedRange.Rows.Count\r\n<span class=\"hljs-comment\">' \u5c06\u6570\u636e\u8303\u56f4\u7684\u503c\u8d4b\u503c\u7ed9\u6570\u7ec4<\/span>\r\narrData = xlWorksheet.Range(<span class=\"hljs-string\">\"A1:B\"<\/span> &amp; numRows).Value\r\n<span class=\"hljs-comment\">' \u5173\u95edExcel\u6587\u4ef6<\/span>\r\nxlWorkbook.Close\r\n<span class=\"hljs-comment\">' \u9000\u51faExcel\u5e94\u7528\u7a0b\u5e8f<\/span>\r\nxlApp.Quit\r\n<span class=\"hljs-comment\">' \u5728\u6570\u7ec4\u4e2d\u5faa\u73af\u8f93\u51fa\u6570\u636e<\/span>\r\n<span class=\"hljs-keyword\">For<\/span> i = <span class=\"hljs-number\">1<\/span> <span class=\"hljs-keyword\">To<\/span> numRows\r\nDebug.Print arrData(i, <span class=\"hljs-number\">1<\/span>) <span class=\"hljs-comment\">' \u7b2c\u4e00\u5217\u7684\u6570\u636e<\/span>\r\nDebug.Print arrData(i, <span class=\"hljs-number\">2<\/span>) <span class=\"hljs-comment\">' \u7b2c\u4e8c\u5217\u7684\u6570\u636e<\/span>\r\n<span class=\"hljs-keyword\">Next<\/span> i\r\n<\/code><\/pre>\n<p>\u4e0a\u306e\u30b3\u30fc\u30c9\u306e &#8220;C:\\Path\\to\\excel_file.xlsx&#8221; \u306e\u90e8\u5206\u3092\u3001\u5b9f\u969b\u306e\u30a8\u30af\u30bb\u30eb\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u306b\u5909\u66f4\u3057\u3001&#8221;Sheet1&#8243; \u3092\u5b9f\u969b\u306e\u4f7f\u7528\u3057\u3066\u3044\u308b\u30b7\u30fc\u30c8\u540d\u306b\u5909\u66f4\u3057\u307e\u3059\u3002\u3053\u306e\u30b3\u30fc\u30c9\u306f\u3001\u30a8\u30af\u30bb\u30eb\u30d5\u30a1\u30a4\u30eb\u306e A1 \u30bb\u30eb\u304b\u3089 B \u5217\u306e\u30c7\u30fc\u30bf\u304c\u6700\u5f8c\u306b\u3042\u308b\u30bb\u30eb\u307e\u3067\u306e\u6570\u5024\u3092\u3001arrData \u3068\u3044\u3046\u4e8c\u6b21\u5143\u914d\u5217\u306b\u683c\u7d0d\u3057\u307e\u3059\u3002\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u3001\u3053\u308c\u3089\u306e\u30b3\u30fc\u30c9\u3092\u81ea\u5206\u306e\u72b6\u6cc1\u306b\u5408\u308f\u305b\u3066\u5909\u66f4\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6b21\u306e\u30b3\u30fc\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001Excel \u306e\u8868\u306e\u30c7\u30fc\u30bf\u3092\u914d\u5217\u306b\u5272\u308a\u5f53\u3066\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 Dim xlApp As Object Dim xlWorkbook As Object Dim xlWorksheet As Objec [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-131602","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Excel \u3067\u914d\u5217\u306b\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5 - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/ja\/blog\/excel-\u3067\u914d\u5217\u306b\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Excel \u3067\u914d\u5217\u306b\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5\" \/>\n<meta property=\"og:description\" content=\"\u6b21\u306e\u30b3\u30fc\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001Excel \u306e\u8868\u306e\u30c7\u30fc\u30bf\u3092\u914d\u5217\u306b\u5272\u308a\u5f53\u3066\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 Dim xlApp As Object Dim xlWorkbook As Object Dim xlWorksheet As Objec [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/excel-\u3067\u914d\u5217\u306b\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-25T10:43:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-28T06:18:35+00:00\" \/>\n<meta name=\"author\" content=\"\u590f\u6a39, \u98a8\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u590f\u6a39, \u98a8\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/excel-%e3%81%a7%e9%85%8d%e5%88%97%e3%81%ab%e5%80%a4%e3%82%92%e8%a8%ad%e5%ae%9a%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/excel-%e3%81%a7%e9%85%8d%e5%88%97%e3%81%ab%e5%80%a4%e3%82%92%e8%a8%ad%e5%ae%9a%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/\",\"name\":\"Excel \u3067\u914d\u5217\u306b\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2024-03-25T10:43:48+00:00\",\"dateModified\":\"2024-03-28T06:18:35+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/4e591db2661c4cc425470b461259391d\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/excel-%e3%81%a7%e9%85%8d%e5%88%97%e3%81%ab%e5%80%a4%e3%82%92%e8%a8%ad%e5%ae%9a%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/excel-%e3%81%a7%e9%85%8d%e5%88%97%e3%81%ab%e5%80%a4%e3%82%92%e8%a8%ad%e5%ae%9a%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/excel-%e3%81%a7%e9%85%8d%e5%88%97%e3%81%ab%e5%80%a4%e3%82%92%e8%a8%ad%e5%ae%9a%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Excel \u3067\u914d\u5217\u306b\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/4e591db2661c4cc425470b461259391d\",\"name\":\"\u590f\u6a39, \u98a8\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/65e0ff40534461b1fa000382dc194e1716f793ab0bcb218ac3c40895551a08c5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/65e0ff40534461b1fa000382dc194e1716f793ab0bcb218ac3c40895551a08c5?s=96&d=mm&r=g\",\"caption\":\"\u590f\u6a39, \u98a8\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/natsukikaze\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/excel-%e3%81%a7%e9%85%8d%e5%88%97%e3%81%ab%e5%80%a4%e3%82%92%e8%a8%ad%e5%ae%9a%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Excel \u3067\u914d\u5217\u306b\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5 - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/ja\/blog\/excel-\u3067\u914d\u5217\u306b\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5\/","og_locale":"ja_JP","og_type":"article","og_title":"Excel \u3067\u914d\u5217\u306b\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5","og_description":"\u6b21\u306e\u30b3\u30fc\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001Excel \u306e\u8868\u306e\u30c7\u30fc\u30bf\u3092\u914d\u5217\u306b\u5272\u308a\u5f53\u3066\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 Dim xlApp As Object Dim xlWorkbook As Object Dim xlWorksheet As Objec [&hellip;]","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/excel-\u3067\u914d\u5217\u306b\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2024-03-25T10:43:48+00:00","article_modified_time":"2024-03-28T06:18:35+00:00","author":"\u590f\u6a39, \u98a8","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u590f\u6a39, \u98a8","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"1\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/excel-%e3%81%a7%e9%85%8d%e5%88%97%e3%81%ab%e5%80%a4%e3%82%92%e8%a8%ad%e5%ae%9a%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/excel-%e3%81%a7%e9%85%8d%e5%88%97%e3%81%ab%e5%80%a4%e3%82%92%e8%a8%ad%e5%ae%9a%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/","name":"Excel \u3067\u914d\u5217\u306b\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2024-03-25T10:43:48+00:00","dateModified":"2024-03-28T06:18:35+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/4e591db2661c4cc425470b461259391d"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/excel-%e3%81%a7%e9%85%8d%e5%88%97%e3%81%ab%e5%80%a4%e3%82%92%e8%a8%ad%e5%ae%9a%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/excel-%e3%81%a7%e9%85%8d%e5%88%97%e3%81%ab%e5%80%a4%e3%82%92%e8%a8%ad%e5%ae%9a%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/excel-%e3%81%a7%e9%85%8d%e5%88%97%e3%81%ab%e5%80%a4%e3%82%92%e8%a8%ad%e5%ae%9a%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"Excel \u3067\u914d\u5217\u306b\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/4e591db2661c4cc425470b461259391d","name":"\u590f\u6a39, \u98a8","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/65e0ff40534461b1fa000382dc194e1716f793ab0bcb218ac3c40895551a08c5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/65e0ff40534461b1fa000382dc194e1716f793ab0bcb218ac3c40895551a08c5?s=96&d=mm&r=g","caption":"\u590f\u6a39, \u98a8"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/natsukikaze\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/excel-%e3%81%a7%e9%85%8d%e5%88%97%e3%81%ab%e5%80%a4%e3%82%92%e8%a8%ad%e5%ae%9a%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/131602","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=131602"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/131602\/revisions"}],"predecessor-version":[{"id":207256,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/131602\/revisions\/207256"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=131602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=131602"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=131602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}