{"id":2077,"date":"2020-03-27T22:58:05","date_gmt":"2020-03-27T22:58:05","guid":{"rendered":"http:\/\/elbsolutions.com\/projects\/?p=2077"},"modified":"2022-02-03T11:24:27","modified_gmt":"2022-02-03T17:24:27","slug":"enable-excels-trust-access-to-the-vba-project-object-model","status":"publish","type":"post","link":"https:\/\/elbsolutions.com\/projects\/enable-excels-trust-access-to-the-vba-project-object-model\/","title":{"rendered":"Enable Excel&#8217;s &#8216;Trust access to the VBA project object model&#8217;"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">It is easy to enable the checkbox in the options screen. The option can also be set <a href=\"https:\/\/stackoverflow.com\/questions\/5300770\/how-to-check-from-net-code-whether-trust-access-to-the-vba-project-object-mode\/44265039\">via a registry entry (or two)<\/a>. To register a change in the registry, Excel must be restarted, but ALSO it is important to note that when Excel exits, it resets this flag. Excel cannot be running therefore. This means we need a few ingredients when we are programming a solution. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First <a href=\"https:\/\/social.msdn.microsoft.com\/Forums\/vstudio\/en-US\/c2a48936-b58f-4487-84ec-dfae842e2fd1\/how-to-check-to-see-if-excel-application-is-already-open?forum=csharpgeneral.\">check if Excel is running<\/a> <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>to do this we have to know the <a href=\"https:\/\/stackoverflow.com\/questions\/3266675\/how-to-detect-installed-version-of-ms-office\">latest Office version<\/a>, <\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li> is it 64 or 32bit as it affects what registry entries could exist. <\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Next set the registry entries<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the user does not need ton know if a setting will be successful , then use the &#8220;set it and hope for the best&#8221; strategy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">has been reset and it will fail anyways &#8211; then just set the 2 registry entries. Set the DWORD &#8216;AccessVBOM&#8217; = 1 to trust.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here are the two registry entries. In short set this one to 1 and the 2nd reg entry item if it exists. <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>HKEY_CURRENT_USER\\Software\\Microsoft\\Office\\16.0\\Excel\\Security\\AccessVBOM<\/li><li>HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Office\\16.0\\Excel\\Security\\AccessVBOM<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>It is easy to enable the checkbox in the options screen. The option can also be set via a registry entry (or two). To register a change in the registry, Excel must be restarted, but ALSO it is important to note that when Excel exits, it resets this flag. Excel cannot be running therefore. This [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2077","post","type-post","status-publish","format-standard","hentry","category-general"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Enable Excel&#039;s &#039;Trust access to the VBA project object model&#039; - ELB Solutions.com Inc.<\/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:\/\/elbsolutions.com\/projects\/enable-excels-trust-access-to-the-vba-project-object-model\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Enable Excel&#039;s &#039;Trust access to the VBA project object model&#039; - ELB Solutions.com Inc.\" \/>\n<meta property=\"og:description\" content=\"It is easy to enable the checkbox in the options screen. The option can also be set via a registry entry (or two). To register a change in the registry, Excel must be restarted, but ALSO it is important to note that when Excel exits, it resets this flag. Excel cannot be running therefore. This [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/elbsolutions.com\/projects\/enable-excels-trust-access-to-the-vba-project-object-model\/\" \/>\n<meta property=\"og:site_name\" content=\"ELB Solutions.com Inc.\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-27T22:58:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-03T17:24:27+00:00\" \/>\n<meta name=\"author\" content=\"Etienne Bley\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Etienne Bley\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/enable-excels-trust-access-to-the-vba-project-object-model\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/enable-excels-trust-access-to-the-vba-project-object-model\\\/\"},\"author\":{\"name\":\"Etienne Bley\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#\\\/schema\\\/person\\\/51e717c68f4f5917c63baf88f0896c39\"},\"headline\":\"Enable Excel&#8217;s &#8216;Trust access to the VBA project object model&#8217;\",\"datePublished\":\"2020-03-27T22:58:05+00:00\",\"dateModified\":\"2022-02-03T17:24:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/enable-excels-trust-access-to-the-vba-project-object-model\\\/\"},\"wordCount\":197,\"articleSection\":[\"General\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/enable-excels-trust-access-to-the-vba-project-object-model\\\/\",\"url\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/enable-excels-trust-access-to-the-vba-project-object-model\\\/\",\"name\":\"Enable Excel's 'Trust access to the VBA project object model' - ELB Solutions.com Inc.\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#website\"},\"datePublished\":\"2020-03-27T22:58:05+00:00\",\"dateModified\":\"2022-02-03T17:24:27+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#\\\/schema\\\/person\\\/51e717c68f4f5917c63baf88f0896c39\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/enable-excels-trust-access-to-the-vba-project-object-model\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/enable-excels-trust-access-to-the-vba-project-object-model\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/enable-excels-trust-access-to-the-vba-project-object-model\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Enable Excel&#8217;s &#8216;Trust access to the VBA project object model&#8217;\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#website\",\"url\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/\",\"name\":\"ELB Solutions.com Inc.\",\"description\":\"Bringing all your IT Pieces together\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#\\\/schema\\\/person\\\/51e717c68f4f5917c63baf88f0896c39\",\"name\":\"Etienne Bley\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g\",\"caption\":\"Etienne Bley\"},\"url\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/author\\\/etienne-bley\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Enable Excel's 'Trust access to the VBA project object model' - ELB Solutions.com Inc.","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:\/\/elbsolutions.com\/projects\/enable-excels-trust-access-to-the-vba-project-object-model\/","og_locale":"en_US","og_type":"article","og_title":"Enable Excel's 'Trust access to the VBA project object model' - ELB Solutions.com Inc.","og_description":"It is easy to enable the checkbox in the options screen. The option can also be set via a registry entry (or two). To register a change in the registry, Excel must be restarted, but ALSO it is important to note that when Excel exits, it resets this flag. Excel cannot be running therefore. This [&hellip;]","og_url":"https:\/\/elbsolutions.com\/projects\/enable-excels-trust-access-to-the-vba-project-object-model\/","og_site_name":"ELB Solutions.com Inc.","article_published_time":"2020-03-27T22:58:05+00:00","article_modified_time":"2022-02-03T17:24:27+00:00","author":"Etienne Bley","twitter_misc":{"Written by":"Etienne Bley","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/elbsolutions.com\/projects\/enable-excels-trust-access-to-the-vba-project-object-model\/#article","isPartOf":{"@id":"https:\/\/elbsolutions.com\/projects\/enable-excels-trust-access-to-the-vba-project-object-model\/"},"author":{"name":"Etienne Bley","@id":"https:\/\/elbsolutions.com\/projects\/#\/schema\/person\/51e717c68f4f5917c63baf88f0896c39"},"headline":"Enable Excel&#8217;s &#8216;Trust access to the VBA project object model&#8217;","datePublished":"2020-03-27T22:58:05+00:00","dateModified":"2022-02-03T17:24:27+00:00","mainEntityOfPage":{"@id":"https:\/\/elbsolutions.com\/projects\/enable-excels-trust-access-to-the-vba-project-object-model\/"},"wordCount":197,"articleSection":["General"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/elbsolutions.com\/projects\/enable-excels-trust-access-to-the-vba-project-object-model\/","url":"https:\/\/elbsolutions.com\/projects\/enable-excels-trust-access-to-the-vba-project-object-model\/","name":"Enable Excel's 'Trust access to the VBA project object model' - ELB Solutions.com Inc.","isPartOf":{"@id":"https:\/\/elbsolutions.com\/projects\/#website"},"datePublished":"2020-03-27T22:58:05+00:00","dateModified":"2022-02-03T17:24:27+00:00","author":{"@id":"https:\/\/elbsolutions.com\/projects\/#\/schema\/person\/51e717c68f4f5917c63baf88f0896c39"},"breadcrumb":{"@id":"https:\/\/elbsolutions.com\/projects\/enable-excels-trust-access-to-the-vba-project-object-model\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/elbsolutions.com\/projects\/enable-excels-trust-access-to-the-vba-project-object-model\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/elbsolutions.com\/projects\/enable-excels-trust-access-to-the-vba-project-object-model\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/elbsolutions.com\/projects\/"},{"@type":"ListItem","position":2,"name":"Enable Excel&#8217;s &#8216;Trust access to the VBA project object model&#8217;"}]},{"@type":"WebSite","@id":"https:\/\/elbsolutions.com\/projects\/#website","url":"https:\/\/elbsolutions.com\/projects\/","name":"ELB Solutions.com Inc.","description":"Bringing all your IT Pieces together","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/elbsolutions.com\/projects\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/elbsolutions.com\/projects\/#\/schema\/person\/51e717c68f4f5917c63baf88f0896c39","name":"Etienne Bley","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g","caption":"Etienne Bley"},"url":"https:\/\/elbsolutions.com\/projects\/author\/etienne-bley\/"}]}},"_links":{"self":[{"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/posts\/2077","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/comments?post=2077"}],"version-history":[{"count":4,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/posts\/2077\/revisions"}],"predecessor-version":[{"id":2081,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/posts\/2077\/revisions\/2081"}],"wp:attachment":[{"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/media?parent=2077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/categories?post=2077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/tags?post=2077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}