I have a code that opens various web pages, copies (Select-All) the information on the web page and then pastes the information into an excel using match destination formatting to ensure that the worksheet replicates the column formatting within the web pages. The code below has worked for months but has stopped working. The web page is no longer copied in a form that permits the required paste function. If I manually Select-All and Control-C to copy then I can paste as required. However, the code still works for a colleague without issue.
I have checked my reset my IE settings to that of my colleague yet it still doesn't work.
The code is as follows.....
Set app = CreateObject("InternetExplorer.Application")
'Creates IE Webpage that the user is logged in and goes to the specific model web page
With app
.Visible = True
.Navigate WebAdd
Do Until .ReadyState = 4
DoEvents
Loop
End With
'Selects the full webpage and copies the contents
app.document.execCommand "SelectAll", False
app.document.execCommand "Copy", False
app.Quit 'closes IE page
Worksheets("Download").Activate
Range("A1").Select
ActiveSheet.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:= _
False, NoHTMLFormatting:=True
ActiveSheet.Cells.WrapText = False
ActiveSheet.Cells.MergeCells = False
IE 11 version 1909 (OS Build 18363.1379)
Any ideas why my IE no longer allows the copying in the correct format or amended coding that would complete the same task? Thanks
I have checked my reset my IE settings to that of my colleague yet it still doesn't work.
The code is as follows.....
Set app = CreateObject("InternetExplorer.Application")
'Creates IE Webpage that the user is logged in and goes to the specific model web page
With app
.Visible = True
.Navigate WebAdd
Do Until .ReadyState = 4
DoEvents
Loop
End With
'Selects the full webpage and copies the contents
app.document.execCommand "SelectAll", False
app.document.execCommand "Copy", False
app.Quit 'closes IE page
Worksheets("Download").Activate
Range("A1").Select
ActiveSheet.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:= _
False, NoHTMLFormatting:=True
ActiveSheet.Cells.WrapText = False
ActiveSheet.Cells.MergeCells = False
IE 11 version 1909 (OS Build 18363.1379)
Any ideas why my IE no longer allows the copying in the correct format or amended coding that would complete the same task? Thanks