{"id":4865,"date":"2016-01-18T13:02:56","date_gmt":"2016-01-18T04:02:56","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=4865"},"modified":"2016-05-21T08:52:40","modified_gmt":"2016-05-20T23:52:40","slug":"vbevbproject","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/vbevbproject\/","title":{"rendered":"VBE\u3092\u64cd\u4f5c\u3059\u308b\uff08VBProject \u30d7\u30ed\u30d1\u30c6\u30a3\uff09"},"content":{"rendered":"<h2>VBProject \u30d7\u30ed\u30d1\u30c6\u30a3<\/h2>\n<div class=\"m30-l\">\n<p>\u6307\u5b9a\u3055\u308c\u305f\u30d6\u30c3\u30af\u306e <strong>VisualBasic \u30d7\u30ed\u30b8\u30a7\u30af\u30c8<\/strong>\u3092\u8868\u3059 <strong>VBProject \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong>\u3092\u8fd4\u3057\u307e\u3059\u3002<strong>VBProject \u30d7\u30ed\u30d1\u30c6\u30a3<\/strong>\u3092\u4f7f\u7528\u3059\u308b\u306b\u306f\u3001\u4e8b\u524d\u306b\u8a2d\u5b9a\u304c\u5fc5\u8981\u3067\u3059\u3002\u8a73\u7d30\u306f\u3001<a href=\"https:\/\/excelwork.info\/excel\/vbevbprojectsettings\/\">VBE \u3092\u30de\u30af\u30ed\u3067\u64cd\u4f5c\u3059\u308b\u6642\u306e\u8a2d\u5b9a\uff08VBProject \u30d7\u30ed\u30d1\u30c6\u30a3\u3001VBE \u30d7\u30ed\u30d1\u30c6\u30a3\uff09<\/a> \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\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>VBProject<\/strong><\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h4>\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>Workbook \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>VBProject \u306e\u4e3b\u306a\u30e1\u30f3\u30d0\u30fc<\/h2>\n<div class=\"m30-l\">\n<br \/>\n<h3>VBProject.Name \u30d7\u30ed\u30d1\u30c6\u30a3<\/h3>\n<p><strong>VisualBasic \u30d7\u30ed\u30b8\u30a7\u30af\u30c8<\/strong>\u306e\u540d\u524d\u3092\u53d6\u5f97\u304a\u3088\u3073\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>Name<\/strong><\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h4>\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>VBProject \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<\/ul><\/div>\n<br \/>\n<h3>VBProject.FileName \u30d7\u30ed\u30d1\u30c6\u30a3<\/h3>\n<p><strong>VisualBasic \u30d7\u30ed\u30b8\u30a7\u30af\u30c8<\/strong> \u3092\u542b\u3080\u30d6\u30c3\u30af\u306e\u30d1\u30b9\u3068\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>FileName<\/strong><\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h4>\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>VBProject \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<\/ul><\/div>\n<br \/>\n<h3>VBProject.Protection \u30d7\u30ed\u30d1\u30c6\u30a3<\/h3>\n<p><strong>VBProject<\/strong> \u306b\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u3066\u5185\u5bb9\u304c\u8868\u793a\u3067\u304d\u306a\u3044\u5834\u5408\u30011 \u3092\u8fd4\u3057\u307e\u3059\u3002<br \/>\n    \u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u3084\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u3066\u3082\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u5165\u529b\u3055\u308c\u3066\u89e3\u9664\u3055\u308c\u3066\u3044\u308b\u72b6\u614b\u306e\u5834\u5408\uff08\u3064\u307e\u308a <strong>VBProject<\/strong> \u306e\u5185\u5bb9\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\uff09\u306f\u30010 \u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>Protection<\/strong><\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h4>\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>VBProject \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<\/ul><\/div>\n<br \/>\n<h3>VBProject.VBComponents \u30d7\u30ed\u30d1\u30c6\u30a3<\/h3>\n<p><strong>VBComponets<\/strong> \u306f\u3001<strong>VBProject<\/strong> \u5185\u306e\u5168\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u8868\u3057\u307e\u3059\u3002<em>index<\/em> \u3067\u3001\u500b\u5225\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u53c2\u7167\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u30e2\u30b8\u30e5\u30fc\u30eb\uff08\u5168\u4f53\uff09\u3092\u53c2\u7167\uff1e<\/strong><\/span><br \/>\n    <em>object<\/em>.<strong>VBProject<\/strong>.<strong>VBComponents<\/strong><\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u7dcf\u6570\u3092\u53d6\u5f97\uff1e<\/strong><\/span><br \/>\n    <em>object<\/em>.<strong>VBProject<\/strong>.<strong>VBComponents<\/strong>.<strong>Count<\/strong><\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u30e2\u30b8\u30e5\u30fc\u30eb\uff08\u500b\u5225\uff09\u3092\u53c2\u7167\uff1e<\/strong><\/span><br \/>\n    <em>object<\/em>.<strong>VBProject<\/strong>.<strong>VBComponents<\/strong> ( <em>index<\/em> )<\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h4>\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>VBProject \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>index&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp; 1 \u304b\u3089\u306f\u3058\u307e\u308b\u6574\u6570\u5024\u3001\u307e\u305f\u306f\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u540d\u524d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<\/ul><\/div>\n<br \/>\n<p class=\"caution4\"><strong>VBComponents<\/strong>\u306e\u30e1\u30f3\u30d0\u30fc\uff08\u30e1\u30bd\u30c3\u30c9\u30fb\u30d7\u30ed\u30d1\u30c6\u30a3\uff09\u306e\u8a73\u7d30\u306b\u95a2\u3057\u3066\u306f\u3001<a href=\"https:\/\/excelwork.info\/excel\/vbcomponents\/\">VBE\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u53c2\u7167\u3059\u308b\uff08VBComponents \u30b3\u30ec\u30af\u30b7\u30e7\u30f3\uff09<\/a> \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p class=\"caution4\"><strong>VBComponent<\/strong>\u306e\u30e1\u30f3\u30d0\u30fc\uff08\u30e1\u30bd\u30c3\u30c9\u30fb\u30d7\u30ed\u30d1\u30c6\u30a3\uff09\u306e\u8a73\u7d30\u306b\u95a2\u3057\u3066\u306f\u3001<a href=\"https:\/\/excelwork.info\/excel\/vbcomponent\/\">  VBE\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u53c2\u7167\u3059\u308b\uff08VBComponent \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09<\/a> \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<\/div>\n<br \/><br \/>\n<h2>VBProject \u30d7\u30ed\u30d1\u30c6\u30a3 \u4f7f\u7528\u4f8b<\/h2>\n<div class=\"m30-l\">\n<h3 id=\"vba_sample\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"VBProject \u30d7\u30ed\u30d1\u30c6\u30a3 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_VBProject()\r\n\r\n    Dim str As String\r\n    Dim num As Integer\r\n    Dim i As Integer\r\n    \r\n    With ActiveWorkbook\r\n    \r\n        str = \"\u3010\u30d1\u30b9\uff06\u30d5\u30a1\u30a4\u30eb\u540d\u3011\uff1a\" & .VBProject.FileName & vbCrLf\r\n        str = str & \"\u3010\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u540d\u524d\u3011\uff1a\" & .VBProject.Name & vbCrLf\r\n        str = str & \"\u3010\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u6709\u7121\u3011\uff1a\"\r\n        If .VBProject.Protection = 1 Then\r\n            str = str & \"\u6709\" & vbCrLf\r\n        Else\r\n            str = str & \"\u7121\" & vbCrLf\r\n        End If\r\n        str = str & \"\u3010\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u7dcf\u6570\u3011\uff1a\" & .VBProject.VBComponents.Count\r\n            \r\n    End With\r\n\r\n    MsgBox str\r\n    \r\nEnd Sub\r\n\u3000\r\n  <\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c<\/h3>\n<p><a href=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/01\/vbproject01.jpg?ssl=1\" rel=\"lightbox[4865]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/01\/vbproject01.jpg?resize=343%2C200&#038;ssl=1\" alt=\"VBProject \u30d7\u30ed\u30d1\u30c6\u30a3\" width=\"343\" height=\"200\" class=\"alignnone size-full wp-image-4874\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n","protected":false},"excerpt":{"rendered":"<p>VBProject \u30d7\u30ed\u30d1\u30c6\u30a3 \u6307\u5b9a\u3055\u308c\u305f\u30d6\u30c3\u30af\u306e VisualBasic \u30d7\u30ed &#8230; <\/p>\n","protected":false},"author":1,"featured_media":4874,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[696],"tags":[63,698,749,363,38],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/01\/vbproject01.jpg?fit=343%2C200&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-1gt","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/4865"}],"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=4865"}],"version-history":[{"count":15,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/4865\/revisions"}],"predecessor-version":[{"id":5550,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/4865\/revisions\/5550"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/4874"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=4865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=4865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=4865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}