I have created macro which gets contents of web site then writes to file,
sometimes its doesnt work as expected.
Sub Test()
Dim ie As Object
'Create an object to Internet Explorer
Set ie = CreateObject("InternetExplorer.Application")
path1 = "http://money.rediff.com/money/jsp/markets_home.jsp"
ie.Visible = False
ie.Navigate (path1)
'Wait till explorer navigate's to the page
While (ie.Busy = True)
Wend
'MsgBox ("Hello")
'All the text on the current window will be assigned to strdata variable
'strdata = ie.Document.getElementByID("mkt_top_index").innerText
'strdata = ie.Document.body.getElementsByTagName
("div")(1).getElementsByTagName("table")(0).innerHTML
strdata = ie.Document.getElementById
("area02").getElementsByTagName("div")(0).getElementsByTagName("table")(0).getEl\
ementsByTagName("table")(0).getElementsByTagName("table")(1).innerText
ActiveCell.FormulaR1C1 = strdata
ActiveWorkbook.SaveAs Filename:="C:\ExcelFile.txt", _
FileFormat:=xlText, CreateBackup:=False
'MsgBox (strdata)
End Sub