<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Download file using WinHttp &#038; ADODB method	</title>
	<atom:link href="https://simpleexcelvba.com/download-file-using-winhttp-adodb-method/feed/" rel="self" type="application/rss+xml" />
	<link>https://simpleexcelvba.com/download-file-using-winhttp-adodb-method/</link>
	<description>Make your office life easier with simple and fast Excel VBA solutions.</description>
	<lastBuildDate>Thu, 05 Dec 2024 08:21:15 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: Tomasz Płociński		</title>
		<link>https://simpleexcelvba.com/download-file-using-winhttp-adodb-method/#comment-26810</link>

		<dc:creator><![CDATA[Tomasz Płociński]]></dc:creator>
		<pubDate>Thu, 05 Dec 2024 08:21:15 +0000</pubDate>
		<guid isPermaLink="false">https://simpleexcelvba.com/?p=1368#comment-26810</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://simpleexcelvba.com/download-file-using-winhttp-adodb-method/#comment-26798&quot;&gt;Miguel Angel&lt;/a&gt;.

On which line the error appears?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://simpleexcelvba.com/download-file-using-winhttp-adodb-method/#comment-26798">Miguel Angel</a>.</p>
<p>On which line the error appears?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Miguel Angel		</title>
		<link>https://simpleexcelvba.com/download-file-using-winhttp-adodb-method/#comment-26798</link>

		<dc:creator><![CDATA[Miguel Angel]]></dc:creator>
		<pubDate>Fri, 06 Sep 2024 18:09:31 +0000</pubDate>
		<guid isPermaLink="false">https://simpleexcelvba.com/?p=1368#comment-26798</guid>

					<description><![CDATA[My case is quite similar to the one of James Burgauer.
This is my code:

Sub downloadFileFromURL()

 Dim httpMethod As WinHttp.WinHttpRequest
 Set httpMethod = New WinHttp.WinHttpRequest

 Dim URL As String
 Let URL = &quot;http://www.todo-poi.es/radar/GARMIN_RADARES/garminvelocidad%202xx-12xx-13xx-14xx-2xxx-3xxx%20y%20posteriores.zip&quot;

 httpMethod.Open &quot;GET&quot;, URL, False
 httpMethod.send

 Dim FilePath As String
 Let FilePath = ThisWorkbook.Path &#038; &quot;\radares.zip&quot;

 ADODBmethod httpMethod, FilePath

End Sub
Sub ADODBmethod(ObjectWinHttp As Object, FileName As String)

 Dim objADOStream As ADODB.Stream
 Set objADOStream = New ADODB.Stream

 objADOStream.Open
 objADOStream.Type = 1

 objADOStream.Write ObjectWinHttp.responseBody
 objADOStream.Position = 0

 Dim objFSO As Scripting.FileSystemObject
 Set objFSO = New Scripting.FileSystemObject

 objADOStream.SaveToFile FileName
 objADOStream.Close

End Sub

I can donwload the file from the web with a browser, but the macro gives an error when executing:

Run-time error ‘-2147012859 (80072f05)’:
Automation Error

(I already have activated both references as indicated)

Any idea?

I&#039;m trying this solution because I&#039;ve found an error on my macro that was working for years without changing anything on my side, with URLDownloadToFile(0, URL, FName, 0, lpfnCB).]]></description>
			<content:encoded><![CDATA[<p>My case is quite similar to the one of James Burgauer.<br />
This is my code:</p>
<p>Sub downloadFileFromURL()</p>
<p> Dim httpMethod As WinHttp.WinHttpRequest<br />
 Set httpMethod = New WinHttp.WinHttpRequest</p>
<p> Dim URL As String<br />
 Let URL = &#8220;http://www.todo-poi.es/radar/GARMIN_RADARES/garminvelocidad%202xx-12xx-13xx-14xx-2xxx-3xxx%20y%20posteriores.zip&#8221;</p>
<p> httpMethod.Open &#8220;GET&#8221;, URL, False<br />
 httpMethod.send</p>
<p> Dim FilePath As String<br />
 Let FilePath = ThisWorkbook.Path &amp; &#8220;\radares.zip&#8221;</p>
<p> ADODBmethod httpMethod, FilePath</p>
<p>End Sub<br />
Sub ADODBmethod(ObjectWinHttp As Object, FileName As String)</p>
<p> Dim objADOStream As ADODB.Stream<br />
 Set objADOStream = New ADODB.Stream</p>
<p> objADOStream.Open<br />
 objADOStream.Type = 1</p>
<p> objADOStream.Write ObjectWinHttp.responseBody<br />
 objADOStream.Position = 0</p>
<p> Dim objFSO As Scripting.FileSystemObject<br />
 Set objFSO = New Scripting.FileSystemObject</p>
<p> objADOStream.SaveToFile FileName<br />
 objADOStream.Close</p>
<p>End Sub</p>
<p>I can donwload the file from the web with a browser, but the macro gives an error when executing:</p>
<p>Run-time error ‘-2147012859 (80072f05)’:<br />
Automation Error</p>
<p>(I already have activated both references as indicated)</p>
<p>Any idea?</p>
<p>I&#8217;m trying this solution because I&#8217;ve found an error on my macro that was working for years without changing anything on my side, with URLDownloadToFile(0, URL, FName, 0, lpfnCB).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Tomasz Płociński		</title>
		<link>https://simpleexcelvba.com/download-file-using-winhttp-adodb-method/#comment-26772</link>

		<dc:creator><![CDATA[Tomasz Płociński]]></dc:creator>
		<pubDate>Wed, 06 Dec 2023 10:40:11 +0000</pubDate>
		<guid isPermaLink="false">https://simpleexcelvba.com/?p=1368#comment-26772</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://simpleexcelvba.com/download-file-using-winhttp-adodb-method/#comment-26758&quot;&gt;James Burgauer&lt;/a&gt;.

Hi James
To help You I need the bigger picture, not just URL :)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://simpleexcelvba.com/download-file-using-winhttp-adodb-method/#comment-26758">James Burgauer</a>.</p>
<p>Hi James<br />
To help You I need the bigger picture, not just URL 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: James Burgauer		</title>
		<link>https://simpleexcelvba.com/download-file-using-winhttp-adodb-method/#comment-26758</link>

		<dc:creator><![CDATA[James Burgauer]]></dc:creator>
		<pubDate>Sat, 12 Aug 2023 06:41:03 +0000</pubDate>
		<guid isPermaLink="false">https://simpleexcelvba.com/?p=1368#comment-26758</guid>

					<description><![CDATA[Everytime I try it, using the URL you or mine (as below) 

Let URL = &quot;https://www.otcmarkets.com/otcapi/company/dns/news/document/68329/content&quot; 

I get the same result:  

Run-time error &#039;-2147012739 (80072f7d)&#039;: 
Automation Error]]></description>
			<content:encoded><![CDATA[<p>Everytime I try it, using the URL you or mine (as below) </p>
<p>Let URL = &#8220;https://www.otcmarkets.com/otcapi/company/dns/news/document/68329/content&#8221; </p>
<p>I get the same result:  </p>
<p>Run-time error &#8216;-2147012739 (80072f7d)&#8217;:<br />
Automation Error</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Tomasz Płociński		</title>
		<link>https://simpleexcelvba.com/download-file-using-winhttp-adodb-method/#comment-26727</link>

		<dc:creator><![CDATA[Tomasz Płociński]]></dc:creator>
		<pubDate>Fri, 12 May 2023 13:36:18 +0000</pubDate>
		<guid isPermaLink="false">https://simpleexcelvba.com/?p=1368#comment-26727</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://simpleexcelvba.com/download-file-using-winhttp-adodb-method/#comment-26726&quot;&gt;Osmar Vila&lt;/a&gt;.

Sounds amazing! You&#039;re welcome! :)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://simpleexcelvba.com/download-file-using-winhttp-adodb-method/#comment-26726">Osmar Vila</a>.</p>
<p>Sounds amazing! You&#8217;re welcome! 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Osmar Vila		</title>
		<link>https://simpleexcelvba.com/download-file-using-winhttp-adodb-method/#comment-26726</link>

		<dc:creator><![CDATA[Osmar Vila]]></dc:creator>
		<pubDate>Fri, 12 May 2023 12:47:23 +0000</pubDate>
		<guid isPermaLink="false">https://simpleexcelvba.com/?p=1368#comment-26726</guid>

					<description><![CDATA[Thanks a lot for the help !!!!!
I&#039;m from Brazil and I managed to find you with the solution !!! Thank you very much]]></description>
			<content:encoded><![CDATA[<p>Thanks a lot for the help !!!!!<br />
I&#8217;m from Brazil and I managed to find you with the solution !!! Thank you very much</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
