Hi Everyone,
I am running a macro that in a nutshell Opens Internet Explorer, does Select All and Copy, and then pastes to
cell A1 in a worksheet. It works flawlessly on one PC but hangs up on the Orange highlighted line below on another
PC. Both PC's are running Windows 10 with exactly the same versions of Excel and Internet Explorer!
Any help would be greatly appreciated!
I am running a macro that in a nutshell Opens Internet Explorer, does Select All and Copy, and then pastes to
cell A1 in a worksheet. It works flawlessly on one PC but hangs up on the Orange highlighted line below on another
PC. Both PC's are running Windows 10 with exactly the same versions of Excel and Internet Explorer!
Any help would be greatly appreciated!
Code:
Sub IMPORT_HTML() Application.ScreenUpdating = False
Application.ExecuteExcel4Macro "show.toolbar(""Ribbon"",True)"
Dim IE As Object
Sheets("IMPORT_HTML").Visible = True
'ActiveWindow.DisplayWorkbookTabs = True
Sheets("IMPORT_HTML").Select
Sheets("IMPORT_HTML").Cells.Select
Sheets("IMPORT_HTML").Select
With Selection
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("A1:Q1000") = "" ' erase previous data
Range("A1").Select
Shell ("C:\Back Office\CLEAR_CLIPBOARD.BAT")
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = False
.navigate "file:///C:/Users/dmgpe/Dropbox/DAILY_SALES_REPORTS/DAY_END.HTML" ' should work for any URL
[B][COLOR=#ff8c00] Do Until .readyState = 4: DoEvents: Loop[/COLOR][/B]
End With
IE.ExecWB 17, 0 '// SelectAll[COLOR=#0000cd][/COLOR]
IE.ExecWB 12, 2 '// Copy selection
Sheets("IMPORT_HTML").Select
Range("A1").Select
Sheets("IMPORT_HTML").PasteSpecial Format:="HTML", link:=False, DisplayAsIcon:=False
Sheets("DASHBOARD").Select
Range("H3").Select
Sheets("IMPORT_HTML").Visible = False
IE.Quit
'IE.Quit ' just to make sure
Application.DisplayFullScreen = True
Application.ExecuteExcel4Macro "show.toolbar(""Ribbon"",False)"
Application.ScreenUpdating = True
End Sub