Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Open a TXT file from WEB ?

Hi,

Would anyone know how to open (read), from the VBA, a TXT file which is on
the web ?


Thank you,

Damir


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Open a TXT file from WEB ?

Here is one way of reading the body text of a web page, you can pass the
webtx string looking for the values and related text as required. You need
to make a reference to Microsoft Office Object Library.

Private sURL As String, webtx As string
Private ie As Object
Sub WebLink()
Set ie = CreateObject("InternetExplorer.Application")
sURL = "http://www.xyz..com"
ie.Navigate sURL
'wait for response
Do Until Not ie.Busy And ie.ReadyState = 4
DoEvents
Loop
' get html page body text
webtx = ie.Document.body.innertext
ie.Visible = True
'close ie and remove memory references
ie.Quit
Set ie = Nothing
End Sub

Cheers
Nigel

"Damir Sudarevic" wrote in message
...
Hi,

Would anyone know how to open (read), from the VBA, a TXT file which is on
the web ?


Thank you,

Damir




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Open a TXT file from WEB ?


the first thing I would try is

workbooks.Open "http://www.mysite.com/myfile.txt"

or turn on the macro recorder, and paste the URL to the file in the
File=Open dialog and see if excel opens it.

--
Regards,
Tom Ogilvy

"Damir Sudarevic" wrote in message
...
Hi,

Would anyone know how to open (read), from the VBA, a TXT file which is on
the web ?


Thank you,

Damir




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. Phillip Pi Excel Discussion (Misc queries) 0 April 23rd 09 08:53 PM
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. Phillip Pi Setting up and Configuration of Excel 0 April 23rd 09 08:53 PM
excel 2003 saved file will not open without a blank workbook open Bob Excel Discussion (Misc queries) 4 November 11th 06 04:24 PM
In Excel - Use Windows Explorer instead of File Open to open file KymY Excel Discussion (Misc queries) 1 August 5th 06 09:59 PM
How do I stop Excel from closing the open file each time I open a. Welsin Setting up and Configuration of Excel 3 January 8th 05 11:16 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"