Newbie at VBA here.
I just had a client ask me to write an Excel VBA thing to read xml given an address. That is, you navigate to http://whatever.com/stuff.asp and you'd see xml in your browser.
I searched around and found this code.
It works fine, I guess, but it says it was written for Excel 2002. Can anyone let me know if this is considered best practice or not? I'm actually targeting Excel 2003.VB Code:
Dim qtsQueries As QueryTables Dim qtQuery As QueryTable Set qtsQueries = ActiveSheet.QueryTables Set qtQuery = qtsQueries.Add _ ("URL;http://whatever.com/stuff.asp", _ Application.Range("A1")) With qtQuery .Refresh If .FetchedRowOverflow Then MsgBox "Your request returned too many results. " _ & "Please refine your search.", vbInformation, "Result Error" End If End With
Thanks,
Mike




Reply With Quote