Hello,
I am trying to hammer out the VBA needed to open a .html file and copy it's contents into Sheet2 of the currently open workbook. My plan is to have a button on Sheet1 that reads "Click to locate file", this will open a dialog and the path will be set as a server path and filtered by .html files. The user would select the appropriate html file and click open. Once the user clicks open I want the contents of the .html file loaded into Sheet2. After that I'd setup a macro that takes the data on Sheet2 and formats it into a table so that I can setup a PivotTable on Sheet3 to display the data.
The .html file is generated on an IBM Mainframe in a text format and saved as html... unfortunately it's going to be a mess to edit the file so that I can actually scrape data... I don't think it's got proper html tags and it's not coma delimited.
Here is where I'm at in the code... still not sure how to get it to pull the file into Sheet2.
I am trying to hammer out the VBA needed to open a .html file and copy it's contents into Sheet2 of the currently open workbook. My plan is to have a button on Sheet1 that reads "Click to locate file", this will open a dialog and the path will be set as a server path and filtered by .html files. The user would select the appropriate html file and click open. Once the user clicks open I want the contents of the .html file loaded into Sheet2. After that I'd setup a macro that takes the data on Sheet2 and formats it into a table so that I can setup a PivotTable on Sheet3 to display the data.
The .html file is generated on an IBM Mainframe in a text format and saved as html... unfortunately it's going to be a mess to edit the file so that I can actually scrape data... I don't think it's got proper html tags and it's not coma delimited.
Here is where I'm at in the code... still not sure how to get it to pull the file into Sheet2.
Code:
[FONT="]Sub openFileDialog()[/FONT][FONT="]
[/FONT]
[FONT="]Dim myFileName as Variable[/FONT]
[FONT="]
[/FONT]
[FONT="]myFileName = Application.GetOpenFileName(FileFilter:=“HTML Files,*.htm*”)[/FONT]
[FONT="]
[/FONT]
[FONT="]If myFileName <> False Then[/FONT]
[FONT="] Workbooks.Open _[/FONT]
[FONT="]FileName:=“\\server\subdir\anothersub\”myFileName[/FONT]
[FONT="]End If[/FONT]
[FONT="]
[/FONT]
[FONT="]End Sub
[/FONT]/CODE]