importint html file to excel from cell B1

snow2001

New Member
Joined
Nov 23, 2018
Messages
2
goodday guys,

im looking for a macro which will get the data from website html file.
But this html file is different every time.
Is there some way i can set a macro to get the data from website when only putting the page which needs to be inmported on for instance putting the hmtl in cell B1?
the http://****/****/(input from cell B1).html

tnx
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
sorry forgot the vba script which i am using.
I am trying to import a html file wich is stored on network drive.
i am putting the file name in cell A1. at this time with the file extension .html i know this extension can be put in vba script but im not so far in scripting :)
but the file wont import getting error not valid.
probly because im using the url import?

anyway any help would be great, here is what i got sofar:


Sub Macro1()

'

' Macro1 Macro

'



'

Range("A2").Select

With ActiveSheet.QueryTables.Add(Connection:= _

"URL;\\tnnt12\g-tn-ptssite\_P&s\WOIS_PERM\q/ks?s=(A1.value)", Destination:=Range("$A$2"))

.Name = "q?s=Activesheet.name"

.FieldNames = True

.RowNumbers = False

.FillAdjacentFormulas = False

.PreserveFormatting = True

.RefreshOnFileOpen = False

.BackgroundQuery = True

.RefreshStyle = xlInsertDeleteCells

.SavePassword = False

.SaveData = True

.AdjustColumnWidth = True

.RefreshPeriod = 0

.WebSelectionType = xlSpecifiedTables

.WebFormatting = xlWebFormattingNone

.WebTables = """table1"""

.WebPreFormattedTextToColumns = True

.WebConsecutiveDelimitersAsOne = True

.WebSingleBlockTextImport = False

.WebDisableDateRecognition = False

.WebDisableRedirections = False

.Refresh BackgroundQuery:=False







End With

End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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