{"id":3688,"date":"2015-12-19T08:35:59","date_gmt":"2015-12-19T06:35:59","guid":{"rendered":"http:\/\/www.ramses.de\/?p=3688"},"modified":"2015-12-19T08:35:59","modified_gmt":"2015-12-19T06:35:59","slug":"faq-excel-einbinden-von-dll-dateien-per-vba","status":"publish","type":"post","link":"https:\/\/www.ramses.de\/?p=3688","title":{"rendered":"FAQ Excel &#8211; Einbinden von DLL Dateien per VBA"},"content":{"rendered":"<h2><strong>Problem <\/strong><\/h2>\n<p>Beim Verwenden von dll Dateien wird in der Arbeitsmappe der Pfad der DLL gespeichert. Dies kann zu Problemen f\u00fchren, wenn auf verschiedenen Rechnern die DLL Dateien an unterschiedlichen Orten gespeichert sind. Dies betrifft zum einen unterschiedliche Office Versionen oder aber 32-Bit oder 64-Bit Windows Versionen die unterschiedliche Systemordner haben.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-3689\" src=\"https:\/\/www.ramses.de\/wp-content\/uploads\/DLL-Dateien-300x230.jpg\" alt=\"DLL Dateien\" width=\"300\" height=\"230\" srcset=\"https:\/\/www.ramses.de\/wp-content\/uploads\/DLL-Dateien-300x230.jpg 300w, https:\/\/www.ramses.de\/wp-content\/uploads\/DLL-Dateien.jpg 471w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Wie hier im Beispiel zu sehen, ist der Programmverweis lang und beinhaltet Versionsinfos wie Office14, dies kann nun per VBA erledigt werden.<\/p>\n<h2><strong>L\u00f6sung <\/strong><\/h2>\n<p>Das Einbinden per VBA ist grunds\u00e4tzlich recht einfach.<\/p>\n<pre>TollerVerweis = \"C:\\Program Files (x86)\\Microsoft Office\\Office14\\MSOUTL.OLB\"\r\n\r\nThisWorkbook.VBProject.References.AddFromFile (TollerVerweis)<\/pre>\n<p>Wir bekommen nun aber eine Fehlermeldung, wenn wir versuchen, den Code ausf\u00fchren zu lassen<\/p>\n<h3>Der programmatische Zugriff auf das Visual Basic-Project ist nicht sicher.<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-3690\" src=\"https:\/\/www.ramses.de\/wp-content\/uploads\/DLL-Fehler-300x166.jpg\" alt=\"DLL Fehler\" width=\"300\" height=\"166\" srcset=\"https:\/\/www.ramses.de\/wp-content\/uploads\/DLL-Fehler-300x166.jpg 300w, https:\/\/www.ramses.de\/wp-content\/uploads\/DLL-Fehler.jpg 460w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Der Zugriff auf das VBA Project ist also grunds\u00e4tzlich als unsicher eingestuft. Bezaubernderweise k\u00f6nnen wir dies aber im Sicherheitscenter \u00e4ndern.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-3691\" src=\"https:\/\/www.ramses.de\/wp-content\/uploads\/DLL-Zugriff-300x109.jpg\" alt=\"DLL Zugriff\" width=\"300\" height=\"109\" srcset=\"https:\/\/www.ramses.de\/wp-content\/uploads\/DLL-Zugriff-300x109.jpg 300w, https:\/\/www.ramses.de\/wp-content\/uploads\/DLL-Zugriff-768x280.jpg 768w, https:\/\/www.ramses.de\/wp-content\/uploads\/DLL-Zugriff-649x234.jpg 649w, https:\/\/www.ramses.de\/wp-content\/uploads\/DLL-Zugriff.jpg 943w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Nach der Aktivierung dieser Option k\u00f6nnen die dll Dateien nunmehr problemlos per Script eingebunden werden.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-3692\" src=\"https:\/\/www.ramses.de\/wp-content\/uploads\/DLL-Erfolg-300x227.jpg\" alt=\"DLL Erfolg\" width=\"300\" height=\"227\" srcset=\"https:\/\/www.ramses.de\/wp-content\/uploads\/DLL-Erfolg-300x227.jpg 300w, https:\/\/www.ramses.de\/wp-content\/uploads\/DLL-Erfolg.jpg 468w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Problem Beim Verwenden von dll Dateien wird in der Arbeitsmappe der Pfad der DLL gespeichert. Dies kann zu Problemen f\u00fchren, wenn auf verschiedenen Rechnern die &#8230; <a title=\"FAQ Excel &#8211; Einbinden von DLL Dateien per VBA\" class=\"read-more\" href=\"https:\/\/www.ramses.de\/?p=3688\" aria-label=\"Mehr Informationen \u00fcber FAQ Excel &#8211; Einbinden von DLL Dateien per VBA\">Weiterlesen &#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[59],"tags":[60,61],"class_list":["post-3688","post","type-post","status-publish","format-standard","hentry","category-excel","tag-excel-2010","tag-vba"],"_links":{"self":[{"href":"https:\/\/www.ramses.de\/index.php?rest_route=\/wp\/v2\/posts\/3688","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ramses.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ramses.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ramses.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ramses.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3688"}],"version-history":[{"count":1,"href":"https:\/\/www.ramses.de\/index.php?rest_route=\/wp\/v2\/posts\/3688\/revisions"}],"predecessor-version":[{"id":3693,"href":"https:\/\/www.ramses.de\/index.php?rest_route=\/wp\/v2\/posts\/3688\/revisions\/3693"}],"wp:attachment":[{"href":"https:\/\/www.ramses.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3688"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ramses.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3688"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ramses.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3688"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}