T
TH
I need a way (using VBA) to test whether or not the user is connected to the
internet. Better yet, to test if the desired site for a web connect is
available. I retrieve stock quotes online for analysis. The obvious
situation is a user is on a plane and still wants to use the model for
analysis, but it auto checks for a current quote. If the quote page is not
available I will simply return without changing the quotes.
Any ideas on how to do this? Is there an error message from a web query?
Thanks, Terry
I searched the google files and found this (incomplete) suggestion from 1999
regarding testing a site:
Hi Tony,
only an idea, but how about writing a batch file that uses tracert on
the various links. Output the texts to files.
eg tracert microsoft.com > microsoft.txt
execute the file using shell
eg shell ("c:\test.bat")
Loop until the last file has been created
x= dir ("c:\mylastfile.txt")
do
x=dir
loop while x =""
then read the contents of the file to see if the destination was found.
Not a great solution , but the best I can think of!
internet. Better yet, to test if the desired site for a web connect is
available. I retrieve stock quotes online for analysis. The obvious
situation is a user is on a plane and still wants to use the model for
analysis, but it auto checks for a current quote. If the quote page is not
available I will simply return without changing the quotes.
Any ideas on how to do this? Is there an error message from a web query?
Thanks, Terry
I searched the google files and found this (incomplete) suggestion from 1999
regarding testing a site:
Hi Tony,
only an idea, but how about writing a batch file that uses tracert on
the various links. Output the texts to files.
eg tracert microsoft.com > microsoft.txt
execute the file using shell
eg shell ("c:\test.bat")
Loop until the last file has been created
x= dir ("c:\mylastfile.txt")
do
x=dir
loop while x =""
then read the contents of the file to see if the destination was found.
Not a great solution , but the best I can think of!