Cheers sfvb,
will have a look at what you have said. As for the specific example I'll try to explain what I'm trying to do;
I am trying to automate a task that is very time comsuming using VBA. What I would like the code to do is as follows
Open up a webpage (I have managed this part) then select the whole of the webpage (which contains a table of data I need), copy it and then paste it into an excel worksheet. I have tried different methods. One was to use edit, get external data and then use the wizard but that only returned no query data available, and another was to use the QueryTable command.
When using the following code it worked to return the google site eg:
Sub WebAccessTest()
'
' WebAccessTest Macro
'
'
ActiveSheet.Select
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;
web address here and file to query" ", Destination:=Range _
("A1"

) 'Where you want it placed on ActiveSheet
.Name = "index" 'What you want the Query to be called
.FieldNames = True 'Some of these may need blocking
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingAll
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.Refresh BackgroundQuery:=False
End With
End Sub
However when I put in the site information I required it would not return any information. Would it make a difference if the site was on the intranet rather than the internet?? To access the site you still need to put in the full URL ie www.
I hope this is what you meant.
I will look at using what you have provided already
Thanks Again
Dave