Vba IE work in background( very urgent)

Sunil7598

New Member
Joined
Dec 28, 2022
Messages
20
Office Version
  1. 2016
Platform
  1. Windows
Hi Guys,

am using Internet explorer to download images from links. but problem is while running macro if switch to any window like chatbox it's typing that file name and path there.

I tied a lot of options but failed.

The code am using is

Set ie = CreateObject("InternetExplorer.application")
ie.Visible = True
Dim rng As Range, cl As Range

Set rng = Range("A6:A" & lr)

'sr = 6
'er = Range("F9").Value + 1
'er = sr - 1
'DPath = Range("g5").Value
For i = 6 To lr
Cells(i, "A").Select
If ActiveCell.EntireRow.Hidden = False Then

URL = ""
URL = Range("B" & i).Value

ie.navigate URL

Do While ie.Busy
DoEvents
Loop
Application.Wait (Now() + TimeValue("0:00:03"))
Application.SendKeys ("^s")
Application.Wait (Now() + TimeValue("0:00:06"))

'Filename:=fldrpth & "\" & "Churn Reminder - " & Format(Date, "dd-mm-yyyy") & "", FileFormat:=51
ie.Visible = True
Application.SendKeys DPath & "\" & Range("A" & i).Value & ".JPEG"
Application.Wait (Now() + TimeValue("0:00:03"))

Application.SendKeys ("~")
else
end if

ie.quit
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,214,943
Messages
6,122,370
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top