Giordano Bruno
Well-known Member
- Joined
- Jan 7, 2007
- Messages
- 1,356
I have this code from MrExcel which used to work well until the http site closed.
<font face=Courier New><SPAN style="color:#00007F">Function</SPAN> FileExistsURL(<SPAN style="color:#00007F">ByVal</SPAN> URL <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">String</SPAN>) <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Boolean</SPAN><br><SPAN style="color:#007F00">'> Supplied by Juan Pablo Gonzalez</SPAN><br><SPAN style="color:#00007F">Dim</SPAN> objXmlftp <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Object</SPAN><br><br><SPAN style="color:#00007F">Set</SPAN> objXmlftp = CreateObject("MSXML2.XMLftp")<br><br>objXmlftp.Open "HEAD", URL, <SPAN style="color:#00007F">False</SPAN><br><SPAN style="color:#00007F">On</SPAN> <SPAN style="color:#00007F">Error</SPAN> <SPAN style="color:#00007F">GoTo</SPAN> ErrChk:<br>objXmlftp.send ""<br>FileExistsURL = objXmlftp.Status = 200<br><br><SPAN style="color:#00007F">Set</SPAN> objXmlftp = <SPAN style="color:#00007F">Nothing</SPAN><br><SPAN style="color:#00007F">Exit</SPAN> <SPAN style="color:#00007F">Function</SPAN><br>ErrChk:<br>FileExistsURL = <SPAN style="color:#00007F">False</SPAN><br><SPAN style="color:#00007F">Set</SPAN> objXmlftp = <SPAN style="color:#00007F">Nothing</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Function</SPAN></FONT>
I'm trying to make it work with files kept in an ftp environment. The address is something like "ftp://ftp.acme.com/XYZ/acme.xls"
I would be grateful if someone could point me in the right direction.
<font face=Courier New><SPAN style="color:#00007F">Function</SPAN> FileExistsURL(<SPAN style="color:#00007F">ByVal</SPAN> URL <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">String</SPAN>) <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Boolean</SPAN><br><SPAN style="color:#007F00">'> Supplied by Juan Pablo Gonzalez</SPAN><br><SPAN style="color:#00007F">Dim</SPAN> objXmlftp <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Object</SPAN><br><br><SPAN style="color:#00007F">Set</SPAN> objXmlftp = CreateObject("MSXML2.XMLftp")<br><br>objXmlftp.Open "HEAD", URL, <SPAN style="color:#00007F">False</SPAN><br><SPAN style="color:#00007F">On</SPAN> <SPAN style="color:#00007F">Error</SPAN> <SPAN style="color:#00007F">GoTo</SPAN> ErrChk:<br>objXmlftp.send ""<br>FileExistsURL = objXmlftp.Status = 200<br><br><SPAN style="color:#00007F">Set</SPAN> objXmlftp = <SPAN style="color:#00007F">Nothing</SPAN><br><SPAN style="color:#00007F">Exit</SPAN> <SPAN style="color:#00007F">Function</SPAN><br>ErrChk:<br>FileExistsURL = <SPAN style="color:#00007F">False</SPAN><br><SPAN style="color:#00007F">Set</SPAN> objXmlftp = <SPAN style="color:#00007F">Nothing</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Function</SPAN></FONT>
I'm trying to make it work with files kept in an ftp environment. The address is something like "ftp://ftp.acme.com/XYZ/acme.xls"
I would be grateful if someone could point me in the right direction.