Excel ile web sayfası açıp kapatmak

Katılım
12 Aralık 2020
Mesajlar
74
Excel Vers. ve Dili
2016 tr
Merhaba

Elimde 528 karakterli bir url var ve bu url nin içinde değişken var bu url yi çalıştırıp kapatacak makro varmıdır acaba ?
 
Katılım
12 Aralık 2020
Mesajlar
74
Excel Vers. ve Dili
2016 tr
Not ; url içi değişkeni ben halledeceğim sadece vba ile web sayfası nasıl açıp kapatılır bilmek istiyorum örnek çalışma vs
 

muratboz06

Destek Ekibi
Destek Ekibi
Katılım
23 Mart 2017
Mesajlar
568
Excel Vers. ve Dili
Office365 TR
Koddaki URL = "https://www.automateexcel.com/excel/" satırını kendinize göre düzenleyiniz.

Kod:
Sub Automate_IE_Load_Page()
'This will load a webpage in IE
    Dim i As Long
    Dim URL As String
    Dim IE As Object
    Dim objElement As Object
    Dim objCollection As Object
    'Create InternetExplorer Object
    Set IE = CreateObject("InternetExplorer.Application")
    'Set IE.Visible = True to make IE visible, or False for IE to run in the background
    IE.Visible = True
    'Define URL
    URL = "https://www.automateexcel.com/excel/"
    'Navigate to URL
    IE.Navigate URL
    ' Statusbar let's user know website is loading
    Application.StatusBar = URL & " is loading. Please wait..."
    ' Wait while IE loading...
    'IE ReadyState = 4 signifies the webpage has loaded (the first loop is set to avoid inadvertently skipping over the second loop)
    Do While IE.ReadyState = 4: DoEvents: Loop   'Do While
    Do Until IE.ReadyState = 4: DoEvents: Loop   'Do Until
    'Webpage Loaded
    Application.StatusBar = URL & " Loaded"
    
    'Unload IE
    Set IE = Nothing
    Set objElement = Nothing
    Set objCollection = Nothing
 
Katılım
12 Aralık 2020
Mesajlar
74
Excel Vers. ve Dili
2016 tr
Koddaki URL = "https://www.automateexcel.com/excel/" satırını kendinize göre düzenleyiniz.

Kod:
Sub Automate_IE_Load_Page()
'This will load a webpage in IE
    Dim i As Long
    Dim URL As String
    Dim IE As Object
    Dim objElement As Object
    Dim objCollection As Object
    'Create InternetExplorer Object
    Set IE = CreateObject("InternetExplorer.Application")
    'Set IE.Visible = True to make IE visible, or False for IE to run in the background
    IE.Visible = True
    'Define URL
    URL = "https://www.automateexcel.com/excel/"
    'Navigate to URL
    IE.Navigate URL
    ' Statusbar let's user know website is loading
    Application.StatusBar = URL & " is loading. Please wait..."
    ' Wait while IE loading...
    'IE ReadyState = 4 signifies the webpage has loaded (the first loop is set to avoid inadvertently skipping over the second loop)
    Do While IE.ReadyState = 4: DoEvents: Loop   'Do While
    Do Until IE.ReadyState = 4: DoEvents: Loop   'Do Until
    'Webpage Loaded
    Application.StatusBar = URL & " Loaded"
 
    'Unload IE
    Set IE = Nothing
    Set objElement = Nothing
    Set objCollection = Nothing
Kodun sonuna end sub yazıyorum applicationstatusbar kısmın
Koddaki URL = "https://www.automateexcel.com/excel/" satırını kendinize göre düzenleyiniz.

Kod:
Sub Automate_IE_Load_Page()
'This will load a webpage in IE
    Dim i As Long
    Dim URL As String
    Dim IE As Object
    Dim objElement As Object
    Dim objCollection As Object
    'Create InternetExplorer Object
    Set IE = CreateObject("InternetExplorer.Application")
    'Set IE.Visible = True to make IE visible, or False for IE to run in the background
    IE.Visible = True
    'Define URL
    URL = "https://www.automateexcel.com/excel/"
    'Navigate to URL
    IE.Navigate URL
    ' Statusbar let's user know website is loading
    Application.StatusBar = URL & " is loading. Please wait..."
    ' Wait while IE loading...
    'IE ReadyState = 4 signifies the webpage has loaded (the first loop is set to avoid inadvertently skipping over the second loop)
    Do While IE.ReadyState = 4: DoEvents: Loop   'Do While
    Do Until IE.ReadyState = 4: DoEvents: Loop   'Do Until
    'Webpage Loaded
    Application.StatusBar = URL & " Loaded"
  
    'Unload IE
    Set IE = Nothing
    Set objElement = Nothing
    Set objCollection = Nothing
[/CODE]

Sub Automate_IE_Load_Page()
'This will load a webpage in IE
Dim i As Long
Dim URL As String
Dim IE As Object
Dim objElement As Object
Dim objCollection As Object
'Create InternetExplorer Object
Dim i as intager
For i = 2 To Sayfa1.Cells(1, 1) + 1
Set IE = CreateObject("InternetExplorer.Application")
'Set IE.Visible = True to make IE visible, or False for IE to run in the background
IE.Visible = True
'Define URL
URL = "https://www.automateexcel.com/excel/"
'Navigate to URL
IE.Navigate URL
' Statusbar let's user know website is loading
Application.StatusBar = URL & " is loading. Please wait..."
' Wait while IE loading...
'IE ReadyState = 4 signifies the webpage has loaded (the first loop is set to avoid inadvertently skipping over the second loop)
Do While IE.ReadyState = 4: DoEvents: Loop 'Do While
Do Until IE.ReadyState = 4: DoEvents: Loop 'Do Until
'Webpage Loaded
Application.StatusBar = URL & " Loaded"

'Unload IE
Set IE = Nothing
Set objElement = Nothing
Set objCollection = Nothing

Next i

End Sub

[/CODE]

Kodu böyle kullanacağım ama hata alıyorum link kısmındaki web adresinde i değişkeni oranın içerisinde yani linki açıp kapatacak döngüye devam edecek
 

muratboz06

Destek Ekibi
Destek Ekibi
Katılım
23 Mart 2017
Mesajlar
568
Excel Vers. ve Dili
Office365 TR
Loop aşağıdaki gibi olması gerekir.
Ayrıca; URL = "https://www.automateexcel.com/excel/"satırına url ataması yapmanız gerekir.
Kod:
Sub Automate_IE_Load_Page()
'This will load a webpage in IE
Dim i As Long
Dim URL As String
Dim IE As Object
Dim objElement As Object
Dim objCollection As Object
'Create InternetExplorer Object

Set IE = CreateObject("InternetExplorer.Application")
'Set IE.Visible = True to make IE visible, or False for IE to run in the background
IE.Visible = True
'Define URL
Dim i as intager
For i = 2 To Sayfa1.Cells(1, 1) + 1
URL = "https://www.automateexcel.com/excel/"
'Navigate to URL
IE.Navigate URL
' Statusbar let's user know website is loading
Application.StatusBar = URL & " is loading. Please wait..."
' Wait while IE loading...
'IE ReadyState = 4 signifies the webpage has loaded (the first loop is set to avoid inadvertently skipping over the second loop)
Do While IE.ReadyState = 4: DoEvents: Loop 'Do While
Do Until IE.ReadyState = 4: DoEvents: Loop 'Do Until
'Webpage Loaded
Application.StatusBar = URL & " Loaded"
Next i
'Unload IE
Set IE = Nothing
Set objElement = Nothing
Set objCollection = Nothing



End Sub
 
Katılım
12 Aralık 2020
Mesajlar
74
Excel Vers. ve Dili
2016 tr
Loop aşağıdaki gibi olması gerekir.
Ayrıca; URL = "https://www.automateexcel.com/excel/"satırına url ataması yapmanız gerekir.
Kod:
Sub Automate_IE_Load_Page()
'This will load a webpage in IE
Dim i As Long
Dim URL As String
Dim IE As Object
Dim objElement As Object
Dim objCollection As Object
'Create InternetExplorer Object

Set IE = CreateObject("InternetExplorer.Application")
'Set IE.Visible = True to make IE visible, or False for IE to run in the background
IE.Visible = True
'Define URL
Dim i as intager
For i = 2 To Sayfa1.Cells(1, 1) + 1
URL = "https://www.automateexcel.com/excel/"
'Navigate to URL
IE.Navigate URL
' Statusbar let's user know website is loading
Application.StatusBar = URL & " is loading. Please wait..."
' Wait while IE loading...
'IE ReadyState = 4 signifies the webpage has loaded (the first loop is set to avoid inadvertently skipping over the second loop)
Do While IE.ReadyState = 4: DoEvents: Loop 'Do While
Do Until IE.ReadyState = 4: DoEvents: Loop 'Do Until
'Webpage Loaded
Application.StatusBar = URL & " Loaded"
Next i
'Unload IE
Set IE = Nothing
Set objElement = Nothing
Set objCollection = Nothing



End Sub
dim i as intager satırında user defined type not defined hatası alıyorum
 
Katılım
12 Aralık 2020
Mesajlar
74
Excel Vers. ve Dili
2016 tr
Loop aşağıdaki gibi olması gerekir.
Ayrıca; URL = "https://www.automateexcel.com/excel/"satırına url ataması yapmanız gerekir.
Kod:
Sub Automate_IE_Load_Page()
'This will load a webpage in IE
Dim i As Long
Dim URL As String
Dim IE As Object
Dim objElement As Object
Dim objCollection As Object
'Create InternetExplorer Object

Set IE = CreateObject("InternetExplorer.Application")
'Set IE.Visible = True to make IE visible, or False for IE to run in the background
IE.Visible = True
'Define URL
Dim i as intager
For i = 2 To Sayfa1.Cells(1, 1) + 1
URL = "https://www.automateexcel.com/excel/"
'Navigate to URL
IE.Navigate URL
' Statusbar let's user know website is loading
Application.StatusBar = URL & " is loading. Please wait..."
' Wait while IE loading...
'IE ReadyState = 4 signifies the webpage has loaded (the first loop is set to avoid inadvertently skipping over the second loop)
Do While IE.ReadyState = 4: DoEvents: Loop 'Do While
Do Until IE.ReadyState = 4: DoEvents: Loop 'Do Until
'Webpage Loaded
Application.StatusBar = URL & " Loaded"
Next i
'Unload IE
Set IE = Nothing
Set objElement = Nothing
Set objCollection = Nothing



End Sub
Automation eror veriyor set ie create object kısmında sarı yanıyor
 
Üst