{"id":4053,"date":"2023-06-30T12:00:51","date_gmt":"2023-06-30T03:00:51","guid":{"rendered":"https:\/\/www.bold.ne.jp\/engineer-club\/?p=4053"},"modified":"2025-12-19T11:05:35","modified_gmt":"2025-12-19T02:05:35","slug":"vba-sleep","status":"publish","type":"post","link":"https:\/\/www.bold.ne.jp\/engineer-club\/vba-sleep","title":{"rendered":"VBA\u306eSleep\u95a2\u6570\u3068\u306f\uff1f\u95a2\u6570\u306e\u89e3\u8aac\u3068\u4f7f\u7528\u4f8b"},"content":{"rendered":"<p>VBA\u3067\u30de\u30af\u30ed\u3092\u4f5c\u6210\u3057\u3066\u3044\u308b\u3068\u304d\u306b\u3001\u300c\u9014\u4e2d\u3067\u5c11\u3057\u51e6\u7406\u3092\u6b62\u3081\u305f\u3044\u300d\u3068\u601d\u3063\u305f\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u304b\uff1f\u25cb\u79d2\u6bce\u306b\u51e6\u7406\u3092\u884c\u3046\u7b49\u306e\u30de\u30af\u30ed\u3092\u4f5c\u6210\u3059\u308b\u5834\u5408\u306f\u3001<span>Sleep<\/span>\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">\u76ee\u6b21<\/p><ul class=\"toc_list\"><li><a href=\"#VBASleep\">\uff11\uff0eVBA\u306eSleep\u95a2\u6570\u306b\u3064\u3044\u3066<\/a><ul><li><a href=\"#-Sleep\">\uff11-\uff11\uff0eSleep\u95a2\u6570\u3068\u306f<\/a><\/li><li><a href=\"#-Wait\">\uff11-\uff12\uff0eWait\u30e1\u30bd\u30c3\u30c9\u3068\u306e\u9055\u3044<\/a><\/li><li><a href=\"#-Sleep-2\">\uff11-\uff13\uff0eSleep\u95a2\u6570\u306e\u69cb\u6587<\/a><\/li><\/ul><\/li><li><a href=\"#Sleep\">\uff12\uff0eSleep\u95a2\u6570\u306e\u4f7f\u7528\u4f8b<\/a><ul><li><a href=\"#i\">\uff12-\uff11\uff0e\u57fa\u672c\u7684\u306a\u4f7f\u7528\u4f8b<\/a><\/li><li><a href=\"#i-2\">\uff12-\uff12\uff0e\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u5834\u5408<\/a><\/li><\/ul><\/li><li><a href=\"#i-3\">\uff13\uff0e\u6700\u5f8c\u306b<\/a><\/li><\/ul><\/div>\n<h2><span id=\"VBASleep\">\uff11\uff0eVBA\u306e<span>Sleep<\/span>\u95a2\u6570\u306b\u3064\u3044\u3066<\/span><\/h2>\n<h3><span id=\"-Sleep\"><span>\uff11-\uff11\uff0eSleep<\/span>\u95a2\u6570\u3068\u306f<\/span><\/h3>\n<p><span>Sleep<\/span>\u95a2\u6570\u3068\u306f<span>WindowsAPI<\/span>\u306e\u6a5f\u80fd\u3067\u3001<strong>\u6307\u5b9a\u3057\u305f\u6642\u9593\u304c\u7d4c\u904e\u3059\u308b\u307e\u3067\u5b9f\u884c\u3092\u4e2d\u65ad\u3057\u3066\u3001\u7d4c\u904e\u5f8c\u306b\u5b9f\u884c\u3092\u518d\u958b\u3057\u307e\u3059<\/strong>\u3002\u6307\u5b9a\u3059\u308b\u6642\u9593\u306f\u3001\u300c\u30df\u30ea\u79d2\u300d\u3067\u884c\u3044\u307e\u3059\u3002\u4f8b\uff09<span>10<\/span>\u79d2\u4e2d\u65ad\u3059\u308b\u5834\u5408\u306f\u3001\u300c<span>10000<\/span>\u300d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u4f3c\u305f\u3088\u3046\u306a\u6a5f\u80fd\u3067\u3001<span>Wait<\/span>\u30e1\u30bd\u30c3\u30c9\u304c\u3042\u308a\u307e\u3059\u3002<span>Wait<\/span>\u30e1\u30bd\u30c3\u30c9\u306b\u3064\u3044\u3066\u306f\u3001\u4e0b\u8a18\u30ea\u30f3\u30af\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n<span style=\"text-decoration:none !important; background-color:#a61e58; color:white; padding:4px 13px; font-size:12px; font-weight:bold; position:relative; top:10px; z-index:1; left:11px;\">\u95a2\u9023\u8a18\u4e8b<\/span>\n<div class=\"blog-card\"><a target=\"_blank\" href=\"https:\/\/www.bold.ne.jp\/engineer-club\/vba-wait\" style=\"text-decoration:none;\">\n    <div class=\"blog-card-thumbnail\"><img src='https:\/\/www.bold.ne.jp\/engineer-club\/wp-content\/uploads\/2023\/07\/shutterstock_389780071-300x190.jpg' alt='VBA\u306eWait\u30e1\u30bd\u30c3\u30c9\u3068\u306f\uff1f\u30e1\u30bd\u30c3\u30c9\u306e\u89e3\u8aac\u3068\u4f7f\u7528\u4f8b' width=158 height=100 \/><\/div>\n    <div class=\"blog-card-content\">\n        <div class=\"blog-card-title\">VBA\u306eWait\u30e1\u30bd\u30c3\u30c9\u3068\u306f\uff1f\u30e1\u30bd\u30c3\u30c9\u306e\u89e3\u8aac\u3068\u4f7f\u7528\u4f8b <\/div>\n        <span style=\"font-size: 12px; font-weight: normal; position:relative; color:#666;\"><i class=\"fa fa-clock-o\"><\/i>&nbsp;2025\/12\/19<\/span>\n    <\/div>\n<div class=\"clear\"><\/div>\n<\/a><\/div>\n<h3><span id=\"-Wait\"><span>\uff11-\uff12\uff0eWait<\/span>\u30e1\u30bd\u30c3\u30c9\u3068\u306e\u9055\u3044<\/span><\/h3>\n<p><span>Sleep<\/span>\u95a2\u6570\u3068<span>Wait<\/span>\u30e1\u30bd\u30c3\u30c9\u3068\u306e\u9055\u3044\u306f\u3001\u4e0b\u8a18\u306e\u8868\u306b\u307e\u3068\u3081\u3066\u3044\u307e\u3059\u3002<\/p>\n<table style=\"border-collapse: collapse; width: 100%; height: 168px;\">\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"width: 30.6011%; height: 24px;\">\u6bd4\u8f03\u5185\u5bb9<\/td>\n<td style=\"width: 33.1147%; height: 24px;\">Sleep<\/td>\n<td style=\"width: 36.2841%; height: 24px;\">Wait<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 30.6011%; height: 24px;\">\u51e6\u7406\u5185\u5bb9<\/td>\n<td style=\"width: 33.1147%; height: 24px;\">\u6307\u5b9a\u3057\u305f\u79d2\u3060\u3051\u51e6\u7406\u3092\u4e2d\u65ad<span><br \/>\n<\/span>\u305d\u306e\u5f8c\u3001\u51e6\u7406\u3092\u518d\u958b<\/td>\n<td style=\"width: 36.2841%; height: 24px;\">\u6307\u5b9a\u3057\u305f\u6642\u9593\u307e\u3067\u51e6\u7406\u3092\u4e2d\u65ad<span><br \/>\n<\/span>\u305d\u306e\u5f8c\u3001\u51e6\u7406\u3092\u518d\u958b<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 30.6011%; height: 24px;\">\u8a2d\u5b9a\u3059\u308b\u5185\u5bb9<\/td>\n<td style=\"width: 33.1147%; height: 24px;\">\u4e2d\u65ad\u3059\u308b\u6642\u9593<\/td>\n<td style=\"width: 36.2841%; height: 24px;\">\u518d\u958b\u3059\u308b\u6642\u9593<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 30.6011%; height: 24px;\">\u8a2d\u5b9a\u3059\u308b\u5024\u306e\u5358\u4f4d\uff08\u5f62\u5f0f\uff09<\/td>\n<td style=\"width: 33.1147%; height: 24px;\">\u30df\u30ea\u79d2<\/td>\n<td style=\"width: 36.2841%; height: 24px;\">hh:mm:ss<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 30.6011%; height: 24px;\">\u6307\u5b9a\u3059\u308b\u6642\u9593\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8<\/td>\n<td style=\"width: 33.1147%; height: 24px;\">Integer\u578b<\/td>\n<td style=\"width: 36.2841%; height: 24px;\">Date\u578b<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 30.6011%; height: 24px;\">\u4e2d\u65ad\u65b9\u6cd5<\/td>\n<td style=\"width: 33.1147%; height: 24px;\">\u306a\u3057<\/td>\n<td style=\"width: 36.2841%; height: 24px;\">ESC\u30dc\u30bf\u30f3\u3092\u62bc\u4e0b<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 30.6011%; height: 24px;\">\u4f7f\u7528\u6642\u306e\u30c7\u30e1\u30ea\u30c3\u30c8<\/td>\n<td style=\"width: 33.1147%; height: 24px;\">\u51e6\u7406\u306e\u4e2d\u65ad\u304c\u3067\u304d\u306a\u3044<\/td>\n<td style=\"width: 36.2841%; height: 24px;\">\u904e\u53bb\u306e\u6642\u9593\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u7121\u9650\u30eb\u30fc\u30d7\u306b\u306a\u308a\u51e6\u7406\u304c\u7d42\u308f\u3089\u306a\u3044<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u63a1\u7528\u57fa\u6e96\u306e\u4e00\u3064\u3068\u3057\u3066\u3001\u4f7f\u7528\u76ee\u7684\u304c\u300c\u4e2d\u65ad\u3059\u308b\u6642\u9593\u300d\u3068\u300c\u518d\u958b\u3059\u308b\u6642\u9593\u300d\u306e\u3069\u3061\u3089\u3092\u76ee\u7684\u3068\u3059\u308b\u304b\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3><span id=\"-Sleep-2\"><span>\uff11-\uff13\uff0eSleep<\/span>\u95a2\u6570\u306e\u69cb\u6587<\/span><\/h3>\n<p><span>Sleep<\/span>\u95a2\u6570\u306e\u69cb\u6587\u306f\u4e0b\u8a18\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">Sleep [\u4e2d\u65ad\u3059\u308b\u6642\u9593\uff08\u30df\u30ea\u79d2\uff09] <\/pre>\n<h2><span id=\"Sleep\">\uff12\uff0e<span>Sleep<\/span>\u95a2\u6570\u306e\u4f7f\u7528\u4f8b<\/span><\/h2>\n<h3><span id=\"i\">\uff12-\uff11\uff0e\u57fa\u672c\u7684\u306a\u4f7f\u7528\u4f8b<\/span><\/h3>\n<p>\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306b\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">Sub sample01()\r\n\r\n    Sleep 5000\r\n    \r\n    MsgBox \"Sleep\u7d42\u4e86\"   '\u51e6\u7406\u4f8b\r\n\r\nEnd Sub\r\n<\/pre>\n<h3><span id=\"i-2\">\uff12-\uff12\uff0e\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u5834\u5408<\/span><\/h3>\n<p>\uff12-\uff11\u306e\u30bd\u30fc\u30b9\u3060\u3051\u3067\u306f\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.bold.ne.jp\/engineer-club\/wp-content\/uploads\/2023\/06\/\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.bold.ne.jp\/engineer-club\/wp-content\/uploads\/2023\/06\/\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc.png\" alt=\"\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc\" width=\"368\" height=\"224\" class=\"alignnone size-full wp-image-4055\" \/><\/a><\/p>\n<p>\u305d\u306e\u5834\u5408\u3001\u4e0b\u8a18\u306e\u4e00\u6587\u3092\u30bd\u30fc\u30b9\u306e\u5148\u982d\u306b\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">Private Declare Sub Sleep Lib \"kernel32\" (ByVal ms As Long)<\/pre>\n<p>\u307e\u305f\u3001<span>OS<\/span>\u304c<span>64<\/span>\u30d3\u30c3\u30c8\u306e\u5834\u5408\u306f\u3001\u4e0a\u8a18\u3092\u8ffd\u52a0\u3057\u3066\u3082\u5225\u306e\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.bold.ne.jp\/engineer-club\/wp-content\/uploads\/2023\/06\/\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc2.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.bold.ne.jp\/engineer-club\/wp-content\/uploads\/2023\/06\/\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc2.png\" alt=\"\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc2\" width=\"861\" height=\"325\" class=\"alignnone size-full wp-image-4056\" srcset=\"https:\/\/www.bold.ne.jp\/engineer-club\/wp-content\/uploads\/2023\/06\/\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc2.png 861w, https:\/\/www.bold.ne.jp\/engineer-club\/wp-content\/uploads\/2023\/06\/\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc2-768x290.png 768w\" sizes=\"(max-width: 861px) 100vw, 861px\" \/><\/a><\/p>\n<p>\u305d\u306e\u5834\u5408\u306f\u3001\u8d64\u6587\u5b57\u306e\u7b87\u6240\u3092\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">Private Declare PtrSafe Sub Sleep Lib \"kernel32\" (ByVal ms As Long)<\/pre>\n<h2><span id=\"i-3\">\uff13\uff0e\u6700\u5f8c\u306b<\/span><\/h2>\n<p>Sleep\u95a2\u6570\u3068<span>Wait<\/span>\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u51e6\u7406\u306f\u4f3c\u3066\u3044\u307e\u3059\u304c\u4f7f\u7528\u76ee\u7684\u306b\u5fdc\u3058\u3066\u4f7f\u3044\u5206\u3051\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>VBA\u3067\u30de\u30af\u30ed\u3092\u4f5c\u6210\u3057\u3066\u3044\u308b\u3068\u304d\u306b\u3001\u300c\u9014\u4e2d\u3067\u5c11\u3057\u51e6\u7406\u3092\u6b62\u3081\u305f\u3044\u300d\u3068\u601d\u3063\u305f\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u304b\uff1f\u25cb\u79d2\u6bce\u306b\u51e6\u7406\u3092\u884c\u3046\u7b49\u306e\u30de\u30af\u30ed\u3092\u4f5c\u6210\u3059\u308b\u5834\u5408\u306f\u3001Sleep\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002 \u76ee\u6b21\uff11\uff0eVBA\u306eSleep\u95a2\u6570\u306b\u3064\u3044\u3066\uff11-\uff11 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":4057,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18],"acf":[],"_links":{"self":[{"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/posts\/4053"}],"collection":[{"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/comments?post=4053"}],"version-history":[{"count":6,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/posts\/4053\/revisions"}],"predecessor-version":[{"id":6225,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/posts\/4053\/revisions\/6225"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/media\/4057"}],"wp:attachment":[{"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/media?parent=4053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/categories?post=4053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}