ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Importing text data from the web (https://www.excelbanter.com/excel-programming/347462-importing-text-data-web.html)

Lawood

Importing text data from the web
 
With Excel 2003 I am importing data from the WEB. This works fine if the file
exists, but not if it doesn't. I would like my macro to be able to handle
both cases. Guess what I am asking is there a way to check and see whether
or not a file exists so I can handle it accordingly.

Steve Yandl

Importing text data from the web
 
If you create the object "MSXML2.XMLHTTP", there is a GET method that will
return status text (OK if the URL is available).

For an example in script that can easily be incorporated into your VBA, take
a look at
http://www.microsoft.com/technet/scr...5/hey0222.mspx

Steve



"Lawood" wrote in message
...
With Excel 2003 I am importing data from the WEB. This works fine if the
file
exists, but not if it doesn't. I would like my macro to be able to handle
both cases. Guess what I am asking is there a way to check and see
whether
or not a file exists so I can handle it accordingly.




Lawood

Importing text data from the web
 
Thanks. This worked fine. Maybe not significant but I noticed this process
does not ask for my Web Site USERID/PASSWORD (the web site data is returned)
whereas the Import data does.

"Steve Yandl" wrote:

If you create the object "MSXML2.XMLHTTP", there is a GET method that will
return status text (OK if the URL is available).

For an example in script that can easily be incorporated into your VBA, take
a look at
http://www.microsoft.com/technet/scr...5/hey0222.mspx

Steve



"Lawood" wrote in message
...
With Excel 2003 I am importing data from the WEB. This works fine if the
file
exists, but not if it doesn't. I would like my macro to be able to handle
both cases. Guess what I am asking is there a way to check and see
whether
or not a file exists so I can handle it accordingly.






All times are GMT +1. The time now is 05:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com