{"id":11,"date":"2009-03-01T21:31:06","date_gmt":"2009-03-01T20:31:06","guid":{"rendered":"http:\/\/niktation.de\/Niktation\/?p=11"},"modified":"2015-01-13T22:36:27","modified_gmt":"2015-01-13T21:36:27","slug":"excel-vba-followhyperlink-einschrankung-umgehen","status":"publish","type":"post","link":"https:\/\/niktation.de\/Niktation\/?p=11","title":{"rendered":"Excel VBA: FollowHyperlink Einschr\u00e4nkung umgehen"},"content":{"rendered":"<p class=\"Body\">Der FollowHyperlink Befehl kann eine URL mit \u00dcbergabeparametern aufrufen. Allerdings d\u00fcrfen URL und Parameter insgesamt nur 256 Zeichen lang sein. Wenn man eine gro\u00dfe Menge Parameter \u00fcbertragen will, muss man tricksen.<\/p>\n<p class=\"Body\">Das VBA script legt hierf\u00fcr einen HTML-file im Temp-Ordner des Windows-Systems an und f\u00fcllt diesen mit einem Java-Script, das automatisch einen Link aufruft, der beliebig lang sein darf. Dieser lokale File wird dann mit FollowHyperlink aufgerufen.<\/p>\n<p class=\"Body\">Dabei wird die Funktion TempDirektory von <a title=\"http:\/\/www.kulpa-online.com\/tipps-vb-systeminfos-5020.html\" href=\"http:\/\/www.kulpa-online.com\/tipps-vb-systeminfos-5020.html\">www.kulpa-online.com<\/a> benutzt.<\/p>\n<blockquote>\n<p class=\"paragraph_style\"><span class=\"style_1\">Sub<\/span> callHyperlink()<\/p>\n<p class=\"paragraph_style_1\">\u00a0\u00a0\u00a0\u00a0&#8216; Dimension all\u00a0 variables.<\/p>\n<p class=\"paragraph_style\">\u00a0\u00a0\u00a0\u00a0<span class=\"style_1\">Dim<\/span> DestFile <span class=\"style_1\">As<\/span> <span class=\"style_1\">String<\/span><\/p>\n<p class=\"paragraph_style\">\u00a0\u00a0\u00a0 <span class=\"style_1\">Dim<\/span> FileNum <span class=\"style_1\">As<\/span> <span class=\"style_1\">Integer<br \/>\n<\/span><\/p>\n<p class=\"paragraph_style\"><span class=\"style_1\">\u00a0\u00a0\u00a0 Dim<\/span> i <span class=\"style_1\">As<\/span> <span class=\"style_1\">Integer<\/span><\/p>\n<p class=\"paragraph_style\">\u00a0\u00a0\u00a0 <span class=\"style_1\">Dim<\/span> param <span class=\"style_1\">As<\/span> <span class=\"style_1\">String<\/span><\/p>\n<p class=\"paragraph_style_1\">\u00a0\u00a0\u00a0 &#8216;initialize webadress param<\/p>\n<p class=\"paragraph_style_2\"><span class=\"style_2\">\u00a0\u00a0\u00a0\u00a0param = <\/span><span class=\"style_3\">&#8220;<\/span><span class=\"style_4\">http:\/\/mypage.de\/myfile.aspx?<\/span><span class=\"style_3\">&#8220;<\/span><span class=\"style_2\"><br \/>\n<\/span><\/p>\n<p class=\"paragraph_style_1\">\u00a0\u00a0\u00a0 &#8216;fill param string like \u201ea1=1&amp;a2=2&#8230;&amp;a256=256\u201c<\/p>\n<p class=\"paragraph_style\">\u00a0\u00a0\u00a0\u00a0<span class=\"style_1\">For<\/span> 1 = <span class=\"style_5\">1<\/span> <span class=\"style_1\">To<\/span> <span class=\"style_5\">256<\/span><\/p>\n<p class=\"paragraph_style\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 param = param + <span class=\"style_6\">&#8220;&amp;a&#8221;<\/span> + <span class=\"style_1\">CStr<\/span>(i) + <span class=\"style_6\">&#8220;=&#8221;<\/span> + <span class=\"style_1\">CStr<\/span>(i)<\/p>\n<p class=\"paragraph_style\">\u00a0\u00a0\u00a0 <span class=\"style_1\">Next<\/span><\/p>\n<p class=\"paragraph_style_1\">\u00a0\u00a0\u00a0\u00a0\u00a0&#8216; define destination html file\u00a0 name.<\/p>\n<p class=\"paragraph_style\">\u00a0\u00a0\u00a0\u00a0DestFile = TempDirectory + <span class=\"style_6\">&#8220;foreward.html&#8221;<\/span><\/p>\n<p class=\"paragraph_style_1\">\u00a0\u00a0\u00a0\u00a0 &#8216; Obtain next free file handle number.<\/p>\n<p class=\"paragraph_style\">\u00a0\u00a0\u00a0\u00a0FileNum = FreeFile()<\/p>\n<p class=\"paragraph_style_1\">\u00a0\u00a0\u00a0\u00a0&#8216; create HTML file with redirection<\/p>\n<p class=\"paragraph_style\">\u00a0\u00a0\u00a0\u00a0<span class=\"style_1\">Print<\/span> #FileNum, <span class=\"style_6\">&#8220;&lt;html&gt;&#8221;<\/span><\/p>\n<p class=\"paragraph_style_3\">\u00a0\u00a0\u00a0 <span class=\"style_1\">Print<\/span> #FileNum, &#8220;&lt;head&gt;&lt;script language=&#8221;&#8221;javascript&#8221;&#8221;&gt;&#8221;<\/p>\n<p class=\"paragraph_style\">\u00a0\u00a0\u00a0 <span class=\"style_1\">Print<\/span> #FileNum, <span class=\"style_6\">&#8220;&lt;!&#8211;&#8220;<\/span><\/p>\n<p class=\"paragraph_style_3\">\u00a0\u00a0\u00a0 <span class=\"style_1\">Print<\/span> #FileNum, &#8220;var weitergeleitet = &#8220;&#8221;&#8221; + param + &#8220;&#8221;&#8221;;&#8221;<\/p>\n<p class=\"paragraph_style_3\">\u00a0\u00a0\u00a0 <span class=\"style_1\">Print<\/span> #FileNum, &#8220;function weiterleitung() {window.location = weitergeleitet;}&#8221;<\/p>\n<p class=\"paragraph_style_3\">\u00a0\u00a0\u00a0 <span class=\"style_1\">Print<\/span> #FileNum, &#8220;setTimeout(&#8220;&#8221;weiterleitung()&#8221;&#8221;, 3000);&#8221;<\/p>\n<p class=\"paragraph_style\">\u00a0\u00a0\u00a0 <span class=\"style_1\">Print<\/span> #FileNum, <span class=\"style_6\">&#8220;\/\/ &#8211;&gt;&#8221;<\/span><\/p>\n<p class=\"paragraph_style\">\u00a0\u00a0\u00a0 <span class=\"style_1\">Print<\/span> #FileNum, <span class=\"style_6\">&#8220;&lt;\/script&gt;&#8221;<\/span><\/p>\n<p class=\"paragraph_style\">\u00a0\u00a0\u00a0 <span class=\"style_1\">Print<\/span> #FileNum, <span class=\"style_6\">&#8220;&lt;\/head&gt;&#8221;<\/span><\/p>\n<p class=\"paragraph_style\">\u00a0\u00a0\u00a0 <span class=\"style_1\">Print<\/span> #FileNum, <span class=\"style_6\">&#8220;&lt;body&gt;&#8221;<\/span><\/p>\n<p class=\"paragraph_style_3\">\u00a0\u00a0\u00a0 <span class=\"style_1\">Print<\/span> #FileNum, &#8220;Please wait, you will be taken to the destination&#8221;<\/p>\n<p class=\"paragraph_style\">\u00a0\u00a0\u00a0 <span class=\"style_1\">Print<\/span> #FileNum, <span class=\"style_6\">&#8220;&lt;\/body&gt;&#8221;<\/span><\/p>\n<p class=\"paragraph_style\">\u00a0\u00a0\u00a0 <span class=\"style_1\">Print<\/span> #FileNum, <span class=\"style_6\">&#8220;&lt;\/html&gt;&#8221;<\/span><\/p>\n<p class=\"paragraph_style_1\">\u00a0\u00a0\u00a0\u00a0\u00a0&#8216; Close destination file.<\/p>\n<p class=\"paragraph_style\">\u00a0\u00a0\u00a0\u00a0<span class=\"style_1\">Close<\/span> #FileNum<\/p>\n<p class=\"paragraph_style\">\u00a0\u00a0\u00a0 ActiveWorkbook.FollowHyperlink Address:=DestFile, _<\/p>\n<p class=\"paragraph_style\">\u00a0\u00a0\u00a0 NewWindow:=True<\/p>\n<p class=\"paragraph_style_4\">End Sub<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Der FollowHyperlink Befehl kann eine URL mit \u00dcbergabeparametern aufrufen. Allerdings d\u00fcrfen URL und Parameter insgesamt nur 256 Zeichen lang sein. Wenn man eine gro\u00dfe Menge Parameter \u00fcbertragen will, muss man tricksen. Das VBA script legt hierf\u00fcr einen HTML-file im Temp-Ordner des Windows-Systems an und f\u00fcllt diesen mit einem Java-Script, das automatisch einen Link aufruft, der&hellip;<\/p>\n <a href=\"https:\/\/niktation.de\/Niktation\/?p=11\" title=\"Excel VBA: FollowHyperlink Einschr\u00e4nkung umgehen\" class=\"entry-more-link\"><span>Read More<\/span> <span class=\"screen-reader-text\">Excel VBA: FollowHyperlink Einschr\u00e4nkung umgehen<\/span><\/a>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"Layout":"","footnotes":""},"categories":[7,8],"tags":[],"class_list":["entry","author-kai_n","post-11","post","type-post","status-publish","format-standard","category-computer","category-programmieren"],"_links":{"self":[{"href":"https:\/\/niktation.de\/Niktation\/index.php?rest_route=\/wp\/v2\/posts\/11","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/niktation.de\/Niktation\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/niktation.de\/Niktation\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/niktation.de\/Niktation\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/niktation.de\/Niktation\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11"}],"version-history":[{"count":3,"href":"https:\/\/niktation.de\/Niktation\/index.php?rest_route=\/wp\/v2\/posts\/11\/revisions"}],"predecessor-version":[{"id":14,"href":"https:\/\/niktation.de\/Niktation\/index.php?rest_route=\/wp\/v2\/posts\/11\/revisions\/14"}],"wp:attachment":[{"href":"https:\/\/niktation.de\/Niktation\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/niktation.de\/Niktation\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/niktation.de\/Niktation\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}