{"id":4947,"date":"2016-01-22T08:47:17","date_gmt":"2016-01-21T23:47:17","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=4947"},"modified":"2016-01-22T08:47:17","modified_gmt":"2016-01-21T23:47:17","slug":"codemoduleproperty","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/codemoduleproperty\/","title":{"rendered":"\u30e2\u30b8\u30e5\u30fc\u30eb\u5185\u306e\u30b3\u30fc\u30c9\u3092\u64cd\u4f5c\u3059\u308b\uff08CodeModule \u306e\u30d7\u30ed\u30d1\u30c6\u30a3\uff09"},"content":{"rendered":"<h2>CodeModule \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/h2>\n<div class=\"m30-l\">\n<p>\u30e2\u30b8\u30e5\u30fc\u30eb\u5185\u306e\u30b3\u30fc\u30c9\u306e\u8ffd\u52a0\u3001\u524a\u9664\u3001\u7de8\u96c6\u7b49\u3092\u884c\u3046\u5834\u5408\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u53d6\u5f97\uff1e<\/strong><\/span><br \/>\n    <em>object<\/em>.<strong>CodeModule<\/strong><\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h3>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5bfe\u8c61\u3068\u306a\u308b <span class=\"red\"><strong>VBComponent \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<\/ul><\/div>\n<\/div>\n<br \/><br \/>\n<h2>CodeModule \u306e\u4e3b\u306a\u30d7\u30ed\u30d1\u30c6\u30a3<\/h2>\n<div class=\"m30-l\">\n<br \/>\n<h3>CodeModule.CountOfLines \u30d7\u30ed\u30d1\u30c6\u30a3<\/h3>\n<p><em>object<\/em> \u3067\u6307\u5b9a\u3057\u305f\u30e2\u30b8\u30e5\u30fc\u30eb\u5185\u306e\u30b3\u30fc\u30c9\u306e\u884c\u6570\u3092\u9577\u6574\u6570\u578b\uff08Long\uff09\u306e\u5024\u3067\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>CountOfLines<\/strong><\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h3>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5bfe\u8c61\u3068\u306a\u308b <span class=\"red\"><strong>CodeModule \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<\/ul><\/div>\n<br \/>\n<h3>CodeModule.CountOfDeclarationLines \u30d7\u30ed\u30d1\u30c6\u30a3<\/h3>\n<p><em>object<\/em> \u3067\u6307\u5b9a\u3057\u305f\u30e2\u30b8\u30e5\u30fc\u30eb\u5185\u306e\u5ba3\u8a00\u30bb\u30af\u30b7\u30e7\u30f3\u306e\u30b3\u30fc\u30c9\u306e\u884c\u6570\u3092\u9577\u6574\u6570\u578b\uff08Long\uff09\u306e\u5024\u3067\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>CountOfDeclarationLines<\/strong><\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h3>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5bfe\u8c61\u3068\u306a\u308b <span class=\"red\"><strong>CodeModule \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<\/ul><\/div>\n<br \/>\n<h3>CodeModule.Lines \u30d7\u30ed\u30d1\u30c6\u30a3<\/h3>\n<p><em>object<\/em> \u3067\u6307\u5b9a\u3057\u305f\u30e2\u30b8\u30e5\u30fc\u30eb\u5185\u3067\u6307\u5b9a\u3057\u305f\u90e8\u5206\u306e\u30b3\u30fc\u30c9\u3092\u6587\u5b57\u5217\u578b\uff08String\uff09\u3067\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>Lines<\/strong> ( <em>startline<\/em> [, <em>count<\/em> ] )<\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h3>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5bfe\u8c61\u3068\u306a\u308b <span class=\"red\"><strong>CodeModule \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>startline&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u53d6\u5f97\u3059\u308b\u5148\u982d\u884c\u3092\u9577\u6574\u6570\u578b\uff08Long\uff09\u306e\u5024\u3067\u6307\u5b9a\u3057\u307e\u3059\uff08 1 \u4ee5\u4e0a\u306e\u5024\uff09\u3002<\/li>\n<li>count&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u53d6\u5f97\u3059\u308b\u884c\u6570\u3092\u9577\u6574\u6570\u578b\uff08Long\uff09\u306e\u5024\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<\/ul><\/div>\n<br \/>\n<h3>CodeModule.ProcBodyLine \u30d7\u30ed\u30d1\u30c6\u30a3<\/h3>\n<p><em>procname<\/em> \u306b\u6307\u5b9a\u3057\u305f\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e\u6700\u521d\u306e\u884c\u3092\u9577\u6574\u6570\u578b\uff08Long\uff09\u306e\u5024\u3067\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u53d6\u5f97\uff1e<\/strong><\/span><br \/>\n    <em>object<\/em>.<strong>ProcBodyLine<\/strong> ( <em>procname<\/em>, <em>prockind<\/em> )<\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h3>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5bfe\u8c61\u3068\u306a\u308b <span class=\"red\"><strong>CodeModule \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>procname&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e\u540d\u524d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>prockind&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e\u7a2e\u985e\u3092\u8868\u3059\u6570\u5024\uff080 \uff5e 3\uff09\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n<table>\n<tr>\n<td align = \"center\" width=\"100\" bgcolor=\"#ffffccc\"><strong>\u5024<\/strong><\/td>\n<td align = \"center\" width=\"400\" bgcolor=\"#ffffccc\"><strong>\u8aac\u660e<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">0<\/td>\n<td width=\"400\">\u30d7\u30ed\u30d1\u30c6\u30a3\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u4ee5\u5916\u306e\u3059\u3079\u3066\u306e\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3<\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">1<\/td>\n<td width=\"400\">\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3<\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">2<\/td>\n<td width=\"400\">\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u53c2\u7167\u3092\u8a2d\u5b9a\u3059\u308b\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3<\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">3<\/td>\n<td width=\"400\">\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u5024\u3092\u53d6\u5f97\u3059\u308b\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3<\/td>\n<\/tr>\n<\/table>\n<p>\n      <\/li>\n<\/ul><\/div>\n<br \/>\n<p class=\"caution4\">\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e\u6700\u521d\u306e\u884c\u3068\u306f\u3001Sub\u3001Function\u3001\u307e\u305f\u306f Property \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u304c\u3042\u308b\u884c\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<br \/>\n<h3>CodeModule.ProcCountLines \u30d7\u30ed\u30d1\u30c6\u30a3<\/h3>\n<p><em>procname<\/em> \u306b\u6307\u5b9a\u3057\u305f\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e\u884c\u6570\u3092 \u9577\u6574\u6570\u578b\uff08Long\uff09\u306e\u5024\u3067\u53d6\u5f97\u3057\u307e\u3059\u3002<br \/>\n    \u3053\u3053\u3067\u306e\u884c\u6570\u306f\u3001<em>procname<\/em> \u306e\u76f4\u524d\u306e\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e \u6700\u7d42\u884c\uff08<strong>End Sub \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/strong>\u3084 <strong>End Function<\/strong> \u306a\u3069\u3092\u542b\u3080\u884c\uff09\u306e\u6b21\u306e\u884c\u3001\u307e\u305f\u306f\u3001\u6700\u3082\u4e0a\u306b\u3042\u308b\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e\u5834\u5408\u306f\u3001<strong>\u5ba3\u8a00\u30bb\u30af\u30b7\u30e7\u30f3<\/strong>\u306e\u6b21\u306e\u884c\u304b\u3089\u6307\u5b9a\u3057\u305f\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e\u6700\u7d42\u884c\u307e\u3067\u306e\u884c\u6570\u3067\u3001\u7a7a\u767d\u884c\u3082\u542b\u307f\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u53d6\u5f97\uff1e<\/strong><\/span><br \/>\n    <em>object<\/em>.<strong>ProcCountLines<\/strong> ( <em>procname<\/em>, <em>prockind<\/em> )<\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h3>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5bfe\u8c61\u3068\u306a\u308b <span class=\"red\"><strong>CodeModule \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>procname&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e\u540d\u524d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>prockind&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e\u7a2e\u985e\u3092\u8868\u3059\u6570\u5024\uff080 \uff5e 3\uff09\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n<table>\n<tr>\n<td align = \"center\" width=\"100\" bgcolor=\"#ffffccc\"><strong>\u5024<\/strong><\/td>\n<td align = \"center\" width=\"400\" bgcolor=\"#ffffccc\"><strong>\u8aac\u660e<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">0<\/td>\n<td width=\"400\">\u30d7\u30ed\u30d1\u30c6\u30a3\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u4ee5\u5916\u306e\u3059\u3079\u3066\u306e\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3<\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">1<\/td>\n<td width=\"400\">\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3<\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">2<\/td>\n<td width=\"400\">\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u53c2\u7167\u3092\u8a2d\u5b9a\u3059\u308b\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3<\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">3<\/td>\n<td width=\"400\">\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u5024\u3092\u53d6\u5f97\u3059\u308b\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3<\/td>\n<\/tr>\n<\/table>\n<p>\n      <\/li>\n<\/ul><\/div>\n<br \/>\n<h3>CodeModule.ProcStartLine \u30d7\u30ed\u30d1\u30c6\u30a3<\/h3>\n<p><em>procname<\/em> \u306b\u6307\u5b9a\u3057\u305f\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e\u958b\u59cb\u884c\u3092\u9577\u6574\u6570\u578b\uff08Long\uff09\u306e\u5024\u3067\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u53d6\u5f97\uff1e<\/strong><\/span><br \/>\n    <em>object<\/em>.<strong>ProcStartLines<\/strong> ( <em>procname<\/em>, <em>prockind<\/em> )<\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h3>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5bfe\u8c61\u3068\u306a\u308b <span class=\"red\"><strong>CodeModule \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>procname&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e\u540d\u524d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>prockind&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e\u7a2e\u985e\u3092\u8868\u3059\u6570\u5024\uff080 \uff5e 3\uff09\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n<table>\n<tr>\n<td align = \"center\" width=\"100\" bgcolor=\"#ffffccc\"><strong>\u5024<\/strong><\/td>\n<td align = \"center\" width=\"400\" bgcolor=\"#ffffccc\"><strong>\u8aac\u660e<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">0<\/td>\n<td width=\"400\">\u30d7\u30ed\u30d1\u30c6\u30a3\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u4ee5\u5916\u306e\u3059\u3079\u3066\u306e\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3<\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">1<\/td>\n<td width=\"400\">\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3<\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">2<\/td>\n<td width=\"400\">\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u53c2\u7167\u3092\u8a2d\u5b9a\u3059\u308b\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3<\/td>\n<\/tr>\n<tr>\n<td width=\"100\" align = \"center\">3<\/td>\n<td width=\"400\">\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u5024\u3092\u53d6\u5f97\u3059\u308b\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3<\/td>\n<\/tr>\n<\/table>\n<p>\n      <\/li>\n<\/ul><\/div>\n<br \/>\n<p class=\"caution4\">\u3053\u3053\u3067\u306e\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e\u958b\u59cb\u884c\u3068\u306f\u3001<em>procname<\/em> \u306e\u76f4\u524d\u306e\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e \u6700\u7d42\u884c\uff08<strong>End Sub \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/strong>\u3084 <strong>End Function<\/strong> \u306a\u3069\u3092\u542b\u3080\u884c\uff09\u306e\u6b21\u306e\u884c\u3001\u307e\u305f\u306f\u3001\u6700\u3082\u4e0a\u306b\u3042\u308b\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e\u5834\u5408\u306f\u3001<strong>\u5ba3\u8a00\u30bb\u30af\u30b7\u30e7\u30f3<\/strong>\u306e\u6b21\u306e\u884c\u3092\u6307\u3057\u307e\u3059\u3002<\/p>\n<br \/>\n<h3>CodeModule.ProcOfLine \u30d7\u30ed\u30d1\u30c6\u30a3<\/h3>\n<p>\u6307\u5b9a\u3055\u308c\u305f\u884c\u304c\u5c5e\u3057\u3066\u3044\u308b\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u540d\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u53d6\u5f97\uff1e<\/strong><\/span><br \/>\n    <em>object<\/em>.<strong>ProcOfLine<\/strong> ( <em>line<\/em>, <em>prockind<\/em> )<\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h3>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5bfe\u8c61\u3068\u306a\u308b <span class=\"red\"><strong>CodeModule \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>line&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u8abf\u3079\u308b\u884c\u3092\u9577\u6574\u6570\u578b\uff08Long\uff09\u306e\u5024\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>prockind&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e\u7a2e\u985e\u3092\u8868\u3059\u6570\u5024\uff080 \uff5e 3\uff09\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<\/ul><\/div>\n<br \/>\n<p class=\"caution4\">\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u5ba3\u8a00\u306e\u524d\u306b\u3042\u308b\u7a7a\u767d\u884c\u3084\u30b3\u30e1\u30f3\u30c8\u884c\u306f\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306b\u542b\u307e\u308c\u307e\u3059\u3002\u6700\u5f8c\u306b\u3042\u308b\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e\u5834\u5408\u306f\u3001\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e\u5f8c\u306b\u3042\u308b\u7a7a\u767d\u884c\u3082\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306b\u542b\u307e\u308c\u307e\u3059\u3002<\/p>\n<\/div>\n<br \/><br \/>\n<h2>CodeModule \u306e\u30d7\u30ed\u30d1\u30c6\u30a3 \u4f7f\u7528\u4f8b<\/h2>\n<div class=\"m30-l\">\n<h3 id=\"vba_sample\">CountOfLines \u30d7\u30ed\u30d1\u30c6\u30a3 \/ CountOfDeclarationLines \u30d7\u30ed\u30d1\u30c6\u30a3 \/ Lines \u30d7\u30ed\u30d1\u30c6\u30a3 \u3092\u4f7f\u3063\u305f\u30b5\u30f3\u30d7\u30eb<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"CodeModule \u306e\u30d7\u30ed\u30d1\u30c6\u30a3 \u4f7f\u7528\u4f8b 1\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_CodeModule01()\r\n    'CountOfDeclarationLines \u30d7\u30ed\u30d1\u30c6\u30a3\r\n    'CountOfLines \u30d7\u30ed\u30d1\u30c6\u30a3\r\n    'Lines \u30d7\u30ed\u30d1\u30c6\u30a3\r\n\r\n    Dim FileName As String\r\n    Dim w As Workbook\r\n    Dim strDec As String\r\n    Dim strAll As String\r\n    \r\n    FileName = \"C:\\Documents\\test01.xlsm\"\r\n    \r\n    '\u30d6\u30c3\u30af\uff08test01.xlsm\uff09\u3092\u30aa\u30fc\u30d7\u30f3\r\n    Set w = Workbooks.Open(FileName)\r\n\r\n    '\u6a19\u6e96\u30e2\u30b8\u30e5\u30fc\u30eb\uff08Module1\uff09\r\n    With w.VBProject.VBComponents.Item(\"Module1\").CodeModule\r\n        \r\n        '\u5ba3\u8a00\u90e8\u5206\u306e\u30b3\u30fc\u30c9\u3092\u53d6\u5f97\r\n        strDec = .LineS(1, .CountOfDeclarationLines) & vbCrLf\r\n        \r\n        'Module1 \u306e\u30b3\u30fc\u30c9\u3059\u3079\u3066\u3092\u53d6\u5f97\r\n        strAll = .LineS(1, .CountOfLines)\r\n        \r\n        'strDec\u3001strAll \u3092\u8868\u793a\r\n        MsgBox \"\uff1c\uff1c\u5ba3\u8a00\u90e8\u5206\u306e\u307f\uff08\" & .CountOfDeclarationLines & \"\u884c\uff09\uff1e\uff1e\" & vbCrLf & _\r\n               strDec & vbCrLf & _\r\n               \"\uff1c\uff1cModule1 \u3059\u3079\u3066\uff08\" & .CountOfLines & \"\u884c\uff09\uff1e\uff1e\" & vbCrLf & _\r\n               strAll\r\n\r\n    End With\r\n    \r\n    \r\n    '\u7d42\u4e86\r\n    w.Saved = True\r\n    w.Close\r\n    Set w = Nothing\r\n\r\nEnd Sub\r\n\u3000\r\n  <\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c 1<\/h3>\n<p><a href=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/01\/CodeModule01.jpg?ssl=1\" rel=\"lightbox[4947]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/01\/CodeModule01.jpg?resize=496%2C620&#038;ssl=1\" alt=\"CodeModule \u30d7\u30ed\u30d1\u30c6\u30a3 1\" width=\"496\" height=\"620\" class=\"alignnone size-full wp-image-4952\" srcset=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/01\/CodeModule01.jpg?w=496&amp;ssl=1 496w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/01\/CodeModule01.jpg?resize=320%2C400&amp;ssl=1 320w\" sizes=\"(max-width: 496px) 100vw, 496px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<br \/><br \/>\n<h3 id=\"vba_sample\">ProcBodyLine \u30d7\u30ed\u30d1\u30c6\u30a3 \/ ProcCountLines \u30d7\u30ed\u30d1\u30c6\u30a3 \/ Lines \u30d7\u30ed\u30d1\u30c6\u30a3 \u3092\u4f7f\u3063\u305f\u30b5\u30f3\u30d7\u30eb<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"CodeModule \u306e\u30d7\u30ed\u30d1\u30c6\u30a3 \u4f7f\u7528\u4f8b 2\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_CodeModule02()\r\n    'ProcBodyLine \u30d7\u30ed\u30d1\u30c6\u30a3\r\n    'ProcCountLines \u30d7\u30ed\u30d1\u30c6\u30a3\r\n    'Lines \u30d7\u30ed\u30d1\u30c6\u30a3\r\n\r\n    Dim FileName As String\r\n    Dim FileCode As String\r\n    Dim w As Workbook\r\n    Dim LineS As Integer\r\n    Dim LineE As Integer\r\n    Dim str As String\r\n    \r\n    FileName = \"C:\\Documents\\test01.xlsm\"\r\n    FileCode = \"C:\\Documents\\tmp\\code.txt\"\r\n    \r\n    '\u30d6\u30c3\u30af\uff08test01.xlsm\uff09\u3092\u30aa\u30fc\u30d7\u30f3\r\n    Set w = Workbooks.Open(FileName)\r\n\r\n    With w.VBProject.VBComponents.Item(\"Module1\").CodeModule\r\n    \r\n        '\u6a19\u6e96\u30e2\u30b8\u30e5\u30fc\u30eb\uff08Module1\uff09\u306b\u3001code.txt \u306e\u5185\u5bb9\uff08sample_macro01\uff09\u3092\u8ffd\u52a0\r\n        .AddFromFile (FileCode)\r\n        \r\n        'Module1 \u306e\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u300csample_macro01\u300d\u306e\u958b\u59cb\u884c\u3092\u53d6\u5f97\r\n        LineS = .ProcStartLine(\"sample_macro01\", 0)\r\n        \r\n        'Module1 \u306e\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u300csample_macro01\u300d\u306e\u884c\u6570\u3092\u53d6\u5f97\r\n        LineE = .ProcCountLines(\"sample_macro01\", 0)\r\n        \r\n        \r\n        '\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u300csample_macro01\u300d\u306e\u5185\u5bb9\r\n        str = .LineS(LineS, LineE)\r\n        \r\n    End With\r\n    \r\n        '\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u300csample_macro01\u300d\u306e\u5185\u5bb9\u3092\u8868\u793a\r\n        MsgBox str\r\n    \r\n    \r\n    '\u7d42\u4e86\r\n    w.Saved = True\r\n    w.Close\r\n    Set w = Nothing\r\n\r\nEnd Sub\r\n\u3000\r\n  <\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c 2<\/h3>\n<p><a href=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/01\/CodeModule02.jpg?ssl=1\" rel=\"lightbox[4947]\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/01\/CodeModule02.jpg?resize=202%2C230&#038;ssl=1\" alt=\"CodeModule \u30d7\u30ed\u30d1\u30c6\u30a3 2\" width=\"202\" height=\"230\" class=\"alignnone size-full wp-image-4953\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<br \/><br \/>\n<h3 id=\"vba_sample\">ProcOfLine \u30d7\u30ed\u30d1\u30c6\u30a3 \u3092\u4f7f\u3063\u305f\u30b5\u30f3\u30d7\u30eb<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"CodeModule \u306e\u30d7\u30ed\u30d1\u30c6\u30a3 \u4f7f\u7528\u4f8b 3\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_CodeModule03()\r\n    'ProcOfLine \u30d7\u30ed\u30d1\u30c6\u30a3\r\n    \r\n    Dim w As Workbook\r\n    Dim str As String\r\n    Dim pname As String\r\n    Dim i As Integer\r\n    \r\n    Set w = ThisWorkbook\r\n    \r\n    'Module2 \u5185\u306b\u3042\u308b\u3059\u3079\u3066\u306e\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e\u540d\u524d\u3092\u53d6\u5f97\r\n    With w.VBProject.VBComponents.Item(\"Module2\").CodeModule\r\n    \r\n        For i = 1 To .CountOfLines\r\n        \r\n            If pname <> .ProcOfLine(i, 0) Then\r\n                \r\n                pname = .ProcOfLine(i, 0)\r\n                str = str & pname & vbCrLf\r\n            \r\n            End If\r\n        \r\n        Next i\r\n    \r\n    End With\r\n    \r\n    '\u8868\u793a\r\n    MsgBox str\r\n    \r\nEnd Sub\r\n\u3000\r\n  <\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c 3<\/h3>\n<p><a href=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/01\/CodeModule03.jpg?ssl=1\" rel=\"lightbox[4947]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/01\/CodeModule03.jpg?resize=202%2C230&#038;ssl=1\" alt=\"CodeModule \u30d7\u30ed\u30d1\u30c6\u30a3 3\" width=\"202\" height=\"230\" class=\"alignnone size-full wp-image-4954\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n","protected":false},"excerpt":{"rendered":"<p>CodeModule \u30aa\u30d6\u30b8\u30a7\u30af\u30c8 \u30e2\u30b8\u30e5\u30fc\u30eb\u5185\u306e\u30b3\u30fc\u30c9\u306e\u8ffd\u52a0\u3001\u524a\u9664\u3001\u7de8\u96c6\u7b49\u3092\u884c &#8230; <\/p>\n","protected":false},"author":1,"featured_media":4952,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[696],"tags":[765,767,766,768,769,770,771,772,63,764,698,749,38],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/01\/CodeModule01.jpg?fit=496%2C620&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-1hN","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/4947"}],"collection":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/comments?post=4947"}],"version-history":[{"count":11,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/4947\/revisions"}],"predecessor-version":[{"id":4982,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/4947\/revisions\/4982"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/4952"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=4947"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=4947"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=4947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}