G
Gwyndalf
I'm fairly new to Vba and have written some code that will open IE and allow
me to navigate to my chosen file. (I cannot use WebQuery to retrieve the
data as it fails to identify any there.) Manual Copy and paste does the
trick but I'm seeking to automate the process. Can anyone advise me how to
instruct IE to 'select all', 'copy' and then paste it into my workbook on the
sheet named 'Hands'.
Sub ListLinks()
Dim IeApp As InternetExplorer
Dim sURL As String
Dim IeDoc As Object
Dim MyURL As String
' I need this to be variable/ user defined
MyURL = Application.GetOpenFilename()
Set IeApp = New InternetExplorer
'Make it visible
IeApp.Visible = True
'define the page to open
sURL = MyURL
'navigate to the page
IeApp.navigate sURL
'Pause the macro using a loop until the
'page is fully loaded
Do
Loop Until IeApp.readyState = READYSTATE_COMPLETE
Code needed here to copy and paste entire web page
Worksheets("Hands").Activate
Range("A1").Select
ActiveSheet.Paste
'Clean up
Set IeApp = Nothing
End Sub
me to navigate to my chosen file. (I cannot use WebQuery to retrieve the
data as it fails to identify any there.) Manual Copy and paste does the
trick but I'm seeking to automate the process. Can anyone advise me how to
instruct IE to 'select all', 'copy' and then paste it into my workbook on the
sheet named 'Hands'.
Sub ListLinks()
Dim IeApp As InternetExplorer
Dim sURL As String
Dim IeDoc As Object
Dim MyURL As String
' I need this to be variable/ user defined
MyURL = Application.GetOpenFilename()
Set IeApp = New InternetExplorer
'Make it visible
IeApp.Visible = True
'define the page to open
sURL = MyURL
'navigate to the page
IeApp.navigate sURL
'Pause the macro using a loop until the
'page is fully loaded
Do
Loop Until IeApp.readyState = READYSTATE_COMPLETE
Code needed here to copy and paste entire web page
Worksheets("Hands").Activate
Range("A1").Select
ActiveSheet.Paste
'Clean up
Set IeApp = Nothing
End Sub