views:

40

answers:

1

Hi

I am trying to copy website data to XL 2003 I was told about using "send keys" but it doesn't work. Please could someone help me.

[code]

Sub CopyInternetDoc()

Dim IntApp As Object
Set IntApp = CreateObject("InternetExplorer.Application")
With IntApp

' Change file name to suit .Visible = True .Navigate "http://test/"

CODE TO COPY data from "http://test/" to Excel   

End With
ActiveSheet.Cells.Select
Selection.ClearContents
ActiveSheet.range("A1").Select
ActiveSheet.Paste
IntApp.Quit
Set IntApp = Nothing

End Sub

[/code]

A: 

If it's appropriate for your data source, you could try using "web queries" instead. Basically, you just set up a QueryTable with an URL parameter; see http://msdn.microsoft.com/en-us/library/aa203721.aspx for more details.

xahtep
I have tried that, but the grid that the web page conatins does not appear in Excel as it is generated by code.Using CTRL + a AND ctrl + C is the only way I can do it so far, but I was told using sendkeys would do this, but it doesn;t work.