{"id":1870,"date":"2017-07-14T01:09:31","date_gmt":"2017-07-14T01:09:31","guid":{"rendered":"http:\/\/elbsolutions.com\/projects\/?p=1870"},"modified":"2022-02-03T11:24:29","modified_gmt":"2022-02-03T17:24:29","slug":"fighting-get-com-visible-vsto-addin-method-can-used-vba","status":"publish","type":"post","link":"https:\/\/elbsolutions.com\/projects\/fighting-get-com-visible-vsto-addin-method-can-used-vba\/","title":{"rendered":"Fighting to get a COM visible VSTO Addin so its method can be used by VBA"},"content":{"rendered":"<p>So I am having some troubles and am learning too much about old technology. In short &#8211; my interface is COM visible to my VBA in my Excel code, but not the class. Crap &#8211; add the word public in front of class &#8211; fixed it. None-the-less here is a blog of what helped me solve my issue. I WANT (insist) early binding (aka intellisense \ud83d\ude42 ) <a href=\"https:\/\/stackoverflow.com\/questions\/10574973\/unable-to-access-com-exposed-methods-in-vba\">(Something close to my issue<\/a>). Want to know even more &#8230; look at the links at the bottom of this article.<\/p>\n<p>First &#8211; set up things properly.<\/p>\n<ul>\n<li>Have a GUID for the interface\u00a0IMyInterface and on the class MyClassO<\/li>\n<li>Have the dual interface turned on on the interface and class<\/li>\n<\/ul>\n<p><!--more--><\/p>\n<ul>\n<li>have a class MyClassO that inherits these Interface StandardOleMarshalObject, IMyInterface<\/li>\n<li>in the ThisAddin.cs &#8230; have the following method\n<ul>\n<li>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nprivate MyClassO utilities;\r\n\/\/\/ &lt;summary&gt;;\r\n\/\/\/\r\n\/\/\/ &lt;\/summary&gt;\r\n\/\/\/ &lt;returns&gt;&lt;\/returns&gt;\r\nprotected override object RequestComAddInAutomationService()\r\n{\r\nif (utilities == null)\r\n{\r\nutilities = new MyClassO();\r\n}return utilities;\r\n}\r\n<\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li>Did you check the Object Broswer in VBA???\n<ul>\n<li>Go to VBA Editor and press F2 or choose View-Object Browser<\/li>\n<li>Change the &#8220;All Libraries&#8221; pull down to the name of you namespace or library<\/li>\n<li>I saw my library &#8211; but just the interface.<\/li>\n<\/ul>\n<\/li>\n<li>Does the <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/d0kh9f4c(v=vs.120).aspx\">OLE \/ Com Object viewer<\/a> show the same? It should<\/li>\n<li>It did! so look at this article <a href=\"https:\/\/blogs.msdn.microsoft.com\/cristib\/2012\/10\/31\/how-com-works-how-to-build-a-com-visible-dll-in-c-net-call-it-from-vba-and-select-the-proper-classinterface-autodispatch-autodual-part12\/\">How COM works<\/a> &#8211; this guy is WAY TO FAMILIAR &#8211; but is the reason I solved my issue &#8211; thanks man!<\/li>\n<\/ul>\n<p>More articles that I wished I put here in my blog but was in my c# code so I copied it here &#8211; hope this helps<\/p>\n<ul>\n<li><a href=\"https:\/\/blogs.msdn.microsoft.com\/andreww\/2008\/08\/11\/why-your-comaddin-object-should-derive-from-standardolemarshalobject\/\">why your com addin object should derive from standardolemarshalobject<\/a><\/li>\n<li><a href=\"https:\/\/blogs.msdn.microsoft.com\/andreww\/2008\/11\/30\/passing-objects-to-exposed-add-in-methods\/\">passing objects to exposed addin methods<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>So I am having some troubles and am learning too much about old technology. In short &#8211; my interface is COM visible to my VBA in my Excel code, but not the class. Crap &#8211; add the word public in front of class &#8211; fixed it. None-the-less here is a blog of what helped me [&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-1870","post","type-post","status-publish","format-standard","hentry","category-general"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Fighting to get a COM visible VSTO Addin so its method can be used by VBA - 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\/fighting-get-com-visible-vsto-addin-method-can-used-vba\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fighting to get a COM visible VSTO Addin so its method can be used by VBA - ELB Solutions.com Inc.\" \/>\n<meta property=\"og:description\" content=\"So I am having some troubles and am learning too much about old technology. In short &#8211; my interface is COM visible to my VBA in my Excel code, but not the class. Crap &#8211; add the word public in front of class &#8211; fixed it. None-the-less here is a blog of what helped me [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/elbsolutions.com\/projects\/fighting-get-com-visible-vsto-addin-method-can-used-vba\/\" \/>\n<meta property=\"og:site_name\" content=\"ELB Solutions.com Inc.\" \/>\n<meta property=\"article:published_time\" content=\"2017-07-14T01:09:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-03T17:24:29+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\\\/fighting-get-com-visible-vsto-addin-method-can-used-vba\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/fighting-get-com-visible-vsto-addin-method-can-used-vba\\\/\"},\"author\":{\"name\":\"Etienne Bley\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#\\\/schema\\\/person\\\/51e717c68f4f5917c63baf88f0896c39\"},\"headline\":\"Fighting to get a COM visible VSTO Addin so its method can be used by VBA\",\"datePublished\":\"2017-07-14T01:09:31+00:00\",\"dateModified\":\"2022-02-03T17:24:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/fighting-get-com-visible-vsto-addin-method-can-used-vba\\\/\"},\"wordCount\":301,\"articleSection\":[\"General\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/fighting-get-com-visible-vsto-addin-method-can-used-vba\\\/\",\"url\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/fighting-get-com-visible-vsto-addin-method-can-used-vba\\\/\",\"name\":\"Fighting to get a COM visible VSTO Addin so its method can be used by VBA - ELB Solutions.com Inc.\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#website\"},\"datePublished\":\"2017-07-14T01:09:31+00:00\",\"dateModified\":\"2022-02-03T17:24:29+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#\\\/schema\\\/person\\\/51e717c68f4f5917c63baf88f0896c39\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/fighting-get-com-visible-vsto-addin-method-can-used-vba\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/fighting-get-com-visible-vsto-addin-method-can-used-vba\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/fighting-get-com-visible-vsto-addin-method-can-used-vba\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fighting to get a COM visible VSTO Addin so its method can be used by VBA\"}]},{\"@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":"Fighting to get a COM visible VSTO Addin so its method can be used by VBA - 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\/fighting-get-com-visible-vsto-addin-method-can-used-vba\/","og_locale":"en_US","og_type":"article","og_title":"Fighting to get a COM visible VSTO Addin so its method can be used by VBA - ELB Solutions.com Inc.","og_description":"So I am having some troubles and am learning too much about old technology. In short &#8211; my interface is COM visible to my VBA in my Excel code, but not the class. Crap &#8211; add the word public in front of class &#8211; fixed it. None-the-less here is a blog of what helped me [&hellip;]","og_url":"https:\/\/elbsolutions.com\/projects\/fighting-get-com-visible-vsto-addin-method-can-used-vba\/","og_site_name":"ELB Solutions.com Inc.","article_published_time":"2017-07-14T01:09:31+00:00","article_modified_time":"2022-02-03T17:24:29+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\/fighting-get-com-visible-vsto-addin-method-can-used-vba\/#article","isPartOf":{"@id":"https:\/\/elbsolutions.com\/projects\/fighting-get-com-visible-vsto-addin-method-can-used-vba\/"},"author":{"name":"Etienne Bley","@id":"https:\/\/elbsolutions.com\/projects\/#\/schema\/person\/51e717c68f4f5917c63baf88f0896c39"},"headline":"Fighting to get a COM visible VSTO Addin so its method can be used by VBA","datePublished":"2017-07-14T01:09:31+00:00","dateModified":"2022-02-03T17:24:29+00:00","mainEntityOfPage":{"@id":"https:\/\/elbsolutions.com\/projects\/fighting-get-com-visible-vsto-addin-method-can-used-vba\/"},"wordCount":301,"articleSection":["General"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/elbsolutions.com\/projects\/fighting-get-com-visible-vsto-addin-method-can-used-vba\/","url":"https:\/\/elbsolutions.com\/projects\/fighting-get-com-visible-vsto-addin-method-can-used-vba\/","name":"Fighting to get a COM visible VSTO Addin so its method can be used by VBA - ELB Solutions.com Inc.","isPartOf":{"@id":"https:\/\/elbsolutions.com\/projects\/#website"},"datePublished":"2017-07-14T01:09:31+00:00","dateModified":"2022-02-03T17:24:29+00:00","author":{"@id":"https:\/\/elbsolutions.com\/projects\/#\/schema\/person\/51e717c68f4f5917c63baf88f0896c39"},"breadcrumb":{"@id":"https:\/\/elbsolutions.com\/projects\/fighting-get-com-visible-vsto-addin-method-can-used-vba\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/elbsolutions.com\/projects\/fighting-get-com-visible-vsto-addin-method-can-used-vba\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/elbsolutions.com\/projects\/fighting-get-com-visible-vsto-addin-method-can-used-vba\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/elbsolutions.com\/projects\/"},{"@type":"ListItem","position":2,"name":"Fighting to get a COM visible VSTO Addin so its method can be used by VBA"}]},{"@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\/1870","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=1870"}],"version-history":[{"count":12,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/posts\/1870\/revisions"}],"predecessor-version":[{"id":1884,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/posts\/1870\/revisions\/1884"}],"wp:attachment":[{"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/media?parent=1870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/categories?post=1870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/tags?post=1870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}