Pulling tables from web

srija

New Member
Joined
Jan 29, 2020
Messages
22
Office Version
  1. 2010
Platform
  1. Windows
  2. Mobile
Hello Guys,

I'm able to pull all the tables from any outside public websites using below VBA Code but I'm not able to pull tables from my company site. It is showing that it is unable to open the site.

Is there any code to open my company site(protected) to pull tables.

Please help me that how can I pull tables from my company site.

VBA Code:
Sub GetCourseList()

Dim URL As String

Dim qt As QueryTable

Dim ws As Worksheet

URL = "XXXXXXXXXXXXXXXXX "
Set ws = ActiveSheet

Set qt = ws.QueryTables.Add( _
Connection:="URL;" & URL, _
Destination:=Range("A1"))

qt.RefreshOnFileOpen = True

qt.Name = "Excel"

qt.FieldNames = True

qt.WebSelectionType = xlAllTables

qt.Refresh BackgroundQuery:=False

End Sub

Thank You
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Do I need to check/select any references to open secured web pages? Please help me
 
Upvote 0
I'm able to open the web page using below VBA code. Is there any way to pull table using below code? Can we merge above mentioned code and below to scrape?

VBA Code:
Dim objShell
Set objShell = CreateObject("WScript.Shell")
    objShell.Run ("""C:\Program Files\Mozilla Firefox\firefox""" & " xyz.com")
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,393
Members
449,081
Latest member
JAMES KECULAH

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