{"id":11912,"date":"2019-07-17T09:26:16","date_gmt":"2019-07-17T00:26:16","guid":{"rendered":"https:\/\/elleneast.com\/?p=11912"},"modified":"2019-08-22T19:49:37","modified_gmt":"2019-08-22T10:49:37","slug":"%e3%80%90vb-net%e3%80%91closedxml%ef%bc%9a%e3%83%8f%e3%82%a4%e3%83%91%e3%83%bc%e3%83%aa%e3%83%b3%e3%82%af","status":"publish","type":"post","link":"https:\/\/elleneast.com\/?p=11912","title":{"rendered":"\u3010VB.NET\u3011ClosedXML\uff1a\u30cf\u30a4\u30d1\u30fc\u30ea\u30f3\u30af"},"content":{"rendered":"[include-page id=\u201d11760\u2033]\n<p>&nbsp;<\/p>\n<p>\u4e0b\u56f3\u306e\u3088\u3046\u306a\u30cf\u30a4\u30d1\u30fc\u30ea\u30f3\u30af\u3092\u6301\u3063\u305f\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/elleneast.com\/wp\/wp-content\/uploads\/programming_topics\/ClosedXML\/ClosedXml_17.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11915 bigshadow\" src=\"https:\/\/elleneast.com\/wp\/wp-content\/uploads\/programming_topics\/ClosedXML\/ClosedXml_17.png\" alt=\"\" width=\"489\" height=\"241\" srcset=\"https:\/\/elleneast.com\/wp\/wp-content\/uploads\/programming_topics\/ClosedXML\/ClosedXml_17.png 489w, https:\/\/elleneast.com\/wp\/wp-content\/uploads\/programming_topics\/ClosedXML\/ClosedXml_17-300x148.png 300w\" sizes=\"auto, (max-width: 489px) 100vw, 489px\"><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>\u30b3\u30fc\u30c9<\/p>\n<pre class=\"lang:vbnet decode:true \">Dim wb = New XLWorkbook\nDim ws = wb.Worksheets.Add(\"\u30cf\u30a4\u30d1\u30fc\u30ea\u30f3\u30af\")\nwb.Worksheets.Add(\"\uff12\u756a\u76ee\u306e\u30b7\u30fc\u30c8\")\n\nDim ro As Int32 = 0\n\n'\u30d6\u30e9\u30a6\u30b6\u3067\u4f7f\u3048\u308b\u3088\u3046\u306a\u30ea\u30f3\u30af\u3092\u4f5c\u6210\u3067\u304d\u307e\u3059\uff1a\n'http, ftp, mailto, gopher, news, nntp, \u306a\u3069\n\nro += 1\nws.Cell(ro, 1).Value = \"Web \u30da\u30fc\u30b8\u3078\u306e\u30ea\u30f3\u30af\u3001\u30c4\u30fc\u30eb\u30c1\u30c3\u30d7\u306a\u3057 - Yahoo! Japan\"\nws.Cell(ro, 1).Hyperlink = New XLHyperlink(\"https:\/\/www.yahoo.co.jp\/\")\n\nro += 1\nws.Cell(ro, 1).Value = \"Web \u30da\u30fc\u30b8\u3078\u306e\u30ea\u30f3\u30af\u3001\u30c4\u30fc\u30eb\u30c1\u30c3\u30d7\u3042\u308a - Yahoo! Japan\"\nws.Cell(ro, 1).Hyperlink = New XLHyperlink(\"https:\/\/www.yahoo.co.jp\/\", \"\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068 Yahoo! Japan \u3078\u98db\u3073\u307e\u3059\")\n\nro += 1\nws.Cell(ro, 1).Value = \"\u30d5\u30a1\u30a4\u30eb\u3078\u306e\u30ea\u30f3\u30af - \u540c\u3058\u30d5\u30a9\u30eb\u30c0\"\nws.Cell(ro, 1).Hyperlink = New XLHyperlink(\".\/Test.xlsx\")\n\nro += 1\nws.Cell(ro, 1).Value = \"\u30d5\u30a1\u30a4\u30eb\u3078\u306e\u30ea\u30f3\u30af - \u76f8\u5bfe\u30a2\u30c9\u30ec\u30b9\"\nws.Cell(ro, 1).Hyperlink = New XLHyperlink(\"..\/Test.xlsx\")\n\nro += 1\nws.Cell(ro, 1).Value = \"\u3053\u306e\u30b7\u30fc\u30c8\u5185\u306e\u30a2\u30c9\u30ec\u30b9\u3078\u306e\u30ea\u30f3\u30af\"\nws.Cell(ro, 1).Hyperlink = New XLHyperlink(\"B1\")\n\nro += 1\nws.Cell(ro, 1).Value = \"\u5225\u306e\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u5185\u306e\u30a2\u30c9\u30ec\u30b9\u3078\u306e\u30ea\u30f3\u30af\"\nws.Cell(ro, 1).Hyperlink = New XLHyperlink(\"'\uff12\u756a\u76ee\u306e\u30b7\u30fc\u30c8'!A1\")\n\n'.Hyperlink \u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u76f4\u63a5\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\n\nro += 1\nws.Cell(ro, 1).Value = \"\u3053\u306e\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u5185\u306e\u7bc4\u56f2\u3078\u306e\u30ea\u30f3\u30af\"\nws.Cell(ro, 1).Hyperlink.InternalAddress = \"B1:C2\"\nws.Cell(ro, 1).Hyperlink.Tooltip = \"\u77e9\u5f62\u7bc4\u56f2\u3078\u306e\u30ea\u30f3\u30af\"\n\nro += 1\nws.Cell(ro, 1).Value = \"E\u30e1\u30fc\u30eb\u30e1\u30c3\u30bb\u30fc\u30b8\u3078\u306e\u30ea\u30f3\u30af\"\nws.Cell(ro, 1).Hyperlink.ExternalAddress = New Uri(\"mailto:SantaClaus@NorthPole.com?subject=\u30d7\u30ec\u30bc\u30f3\u30c8\u306b\u3064\u3044\u3066\")\n\n'\u30cf\u30a4\u30d1\u30fc\u30ea\u30f3\u30af\u306e\u524a\u9664\nro += 1\nws.Cell(ro, 1).Value = \"\u3053\u308c\u306f\u3082\u3046\u30ea\u30f3\u30af\u3067\u306f\u3042\u308a\u307e\u305b\u3093\"\nws.Cell(ro, 1).Hyperlink.InternalAddress = \"A1\"\nws.Cell(ro, 1).Hyperlink.Delete\n\n'\u30cf\u30a4\u30d1\u30fc\u30ea\u30f3\u30af\u3092\u8a2d\u5b9a\u3057\u3066\u3082\u65e2\u5b58\u306e\u66f8\u5f0f\u306f\u4fdd\u6301\u3055\u308c\u307e\u3059\nro += 1\nws.Cell(ro, 1).Value = \"\u8d64\u6587\u5b57\u30fb\u4e8c\u91cd\u4e0b\u7dda\u306e\u30bb\u30eb\u306b\u30ea\u30f3\u30af\u3092\u8ffd\u52a0\"\nws.Cell(ro, 1).Style.Font.FontColor = XLColor.Red\nws.Cell(ro, 1).Style.Font.Underline = XLFontUnderlineValues.Double\nws.Cell(ro, 1).Hyperlink = New XLHyperlink(ws.Range(\"B1:C2\"))\n\n'\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u5185\u306e\u3059\u3079\u3066\u306e\u30cf\u30a4\u30d1\u30fc\u30ea\u30f3\u30af\u306e\u30ea\u30b9\u30c8\nDim hyperlinksInWorksheet = ws.Hyperlinks\n\n'\u7bc4\u56f2\u5185\u306e\u3059\u3079\u3066\u306e\u30cf\u30a4\u30d1\u30fc\u30ea\u30f3\u30af\u306e\u30ea\u30b9\u30c8\nDim hyperlinksInRange = ws.Range(\"A1:A3\").Hyperlinks\n\n'\u30b3\u30f3\u30c6\u30f3\u30c4\u304c\u65e5\u672c\u8a9e\u306e\u5834\u5408\u306f\u65e5\u672c\u8a9e\u30d5\u30a9\u30f3\u30c8\u306b\u3057\u3066\u304a\u304b\u306a\u3044\u3068 AdjustToContents \u304c\u6b63\u3057\u304f\u52d5\u4f5c\u3057\u306a\u3044\nws.Style.Font.FontName = \"\u6e38\u30b4\u30b7\u30c3\u30af\";\nws.Columns.AdjustToContents\n\nwb.SaveAs(\"D:\\test\\Hyperlinks.xlsx\")<\/pre>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/elleneast.com\/?cat=90\">\u300c\u3010VB.NET\u3011ClosedXML \u306e\u4f7f\u3044\u65b9\u300d\u306e\u4e00\u89a7\u3092\u8868\u793a<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[include-page id=\u201d11760\u2033] &nbsp; \u4e0b\u56f3\u306e\u3088\u3046\u306a\u30cf\u30a4\u30d1\u30fc\u30ea\u30f3\u30af\u3092\u6301\u3063\u305f\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 &nbsp; \u30b3\u30fc\u30c9 Dim wb = New XLWorkbook Dim ws = wb &#8230; <\/p>\n","protected":false},"author":1,"featured_media":2656,"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":[90],"tags":[],"class_list":{"0":"post-11912","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-closedxml"},"_links":{"self":[{"href":"https:\/\/elleneast.com\/index.php?rest_route=\/wp\/v2\/posts\/11912","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elleneast.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elleneast.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elleneast.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elleneast.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11912"}],"version-history":[{"count":3,"href":"https:\/\/elleneast.com\/index.php?rest_route=\/wp\/v2\/posts\/11912\/revisions"}],"predecessor-version":[{"id":12955,"href":"https:\/\/elleneast.com\/index.php?rest_route=\/wp\/v2\/posts\/11912\/revisions\/12955"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/elleneast.com\/index.php?rest_route=\/wp\/v2\/media\/2656"}],"wp:attachment":[{"href":"https:\/\/elleneast.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11912"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elleneast.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11912"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elleneast.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11912"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}