View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default url not accessible

Mike,
If you record a macro whilst do a web query to
www.dealerfinancesolutions.com/update.txt, you will see that the actual URL
recorded points to home.wi.rr.com/theolsons4/update.txt.
As such, it seems that Excel cannot use your desired URL, possibly due to
redirection and/or the way the site is set up. But that's conjecture on my
part.

If you force a web query with www.dealerfinancesolutions.com/update.txt, I
get this text string returned:
"dealerfinancesolutions.com;http://home.wi.rr.com/theolsons4/;//update.txt"

I suppose you could parse that string, extract the "real" URL and use that
in a secondary web query.
Or set a reference to "Microsoft WinHTTP Services" and get the real URL
yourself:

Dim WithEvents HTTPStuff As WinHttpRequest

Private Sub CommandButton1_Click()

Set HTTPStuff = New WinHttpRequest

With HTTPStuff
.Open "GET", "http://www.dealerfinancesolutions.com/update.txt"
.Send
End With
End Sub

Private Sub HTTPStuff_OnResponseFinished()
MsgBox HTTPStuff.ResponseText
End Sub

Or maybe other components over which you have more control. e.g. Automating
IE

By the way, it looks like you txt file has a lot of extraneous Tab after the
data.

NickHK

"mikeolson" wrote in message
...
the "site under construction" is a pubished blank page, when the

update.txt
is added it works fine if I use the home.wi.rr.com/theolsons4/update.txt

but
not when www.dealerfinancesolutions.com/update.txt is used in my macro.

Any
suggestions?

Mike

"NickHK" wrote:

Mike,
If I first go to "http//www.dealerfinancesolutions.com", I get a "site

under
construction. Then add the "update.txt" to the URL, I get the text file.
So, maybe something in the way the site is set up ?

NickHK

"mikeolson" wrote in message
...
I have tried it with just the website. Here are the to actual

websites
involved:
the file I am after for the update is:
http//home.wi.rr.com/theolsons4/update.txt
http//www.dealerfinancesolutions.com/update.txt
the home.wi works great in the code, the other does not

Thanks!

Mike

"Don Guillett" wrote:

Hard to tell without testing the actual but
Have you tried it with just the website?

--
Don Guillett
SalesAid Software

"mikeolson" wrote in message
...
I have a macro that imports a text file from a website, it works

fine.
However, the macro contains the website where it is being hosted:
http//home.wi.rr.com/myusername/file.txt
My website: http//www.mywebsitename.com is currently hosted on

the
above
location. If I change the location, now my macro has the wrong

url in
the
code. When I use the http//www.mywebsitename.com/file.txt it does

not
access
the file, change to the other address it works fine. Why won't it

work?
If
I type both addresses in my web browser, I get the same result,

why
not in
the macro code?

Thank you for your help!
Mike