Fetch values from HTML files to Excel sheet - excel

I have multiple HTML files in my folder. I need to fetch some data from each html files and copy those value in excel sheet using VBA MACRO. how to write code to achieve this?.
And the html files should open in Microsoft edge browser (not in IE)
If any one knows the solution please help me out.
Thank you

You said,'the HTML files should open in Microsoft Edge browser (not in IE)'.
If your goal is to copy the data to an Excel sheet then I think it should not matter whether you are doing it via IE or Edge.
If you are thinking that as IE browser is retired on some Windows OS and your IE VBA Automation will not work then I would like to inform you that IE VBA automation will continue to work even after the IE browser retirement.
If you still want to automate the Edge browser then as suggested by the community member, you will need to use the web driver.
For VBA IE Automation the general idea would be to create an object of the IE or Edge browser from the Excel VBA editor. Launch the browser. Browse the web page. browse to the web element and copy the data to the Excel sheet.
If you use Selenium then you also need to use the library for Excel and create an object of the Excel file.
For more information, you could refer to the links below.
Use WebDriver to automate Microsoft Edge
Automate Microsoft Edge
Similar kinds of articles and docs you could find for the IE VBA Automation.
You could refer to the docs and try to make tests on your side. If you are stuck somewhere or have any questions. you could post a new question on this forum.

Related

Excel VBA: Web scraping now IE11 is nearly obsolete

I’ve been using an Excel 2019 VBA InternetExplorer object to login to websites and get data via Copy and Paste. This has been an uphill struggle and, taking to account that IE11 is now all but obsolete, what is the way forward? Edge isn't supported in Excel for some reason. I don’t need anything complicated, just to be able to login to a website and download screens/tables of data. The options as I understand are:
XMLHTTP – great for simple websites, but it seems to be very hard to login to websites?
Selenium – not portable.
Are MS going to replace IE with something else in VBA?
Are there any other ways for what must be required by millions of people?

EXCEL VBA (URLDownloadToFile) Not working Due to Site not allowing IE11

I was wondering if anyone had an idea about how to get URLtoDownloadfile to work but get it to use Microsoft Edge as opposed to IE11. The websites trying to pull PDF's from now doesn't support IE11 so it just takes you to an error page. Plus I believe Microsoft are pulling it next year completely.
The reason for wanting to use this is because we want to save to a specific folder and file name based on logic within the excel document?
It was working perfectly up until one of the websites changed it support for IE11 so any help would be much appreciated.
Happy to paste in the code if that helps.
Thanks,

Is it possible to embed an Excel worksheet alongside a Visio drawing in a webpage and interact across them with the office-js apis

I would like to build a webpage with 2 embedded iFrames - 1x Visio and 1x Excel and use the Visio.run and Excel.run office-js mechanisms to interrogate and interact across them in Office 365.
After various permissioning bug issues I now have Visio javascript code working nicely but cannot see how to get Excel working in a similar manner and I suspect I might have to host an embedded Visio drawing within an Excel task pane rather than having them as peer iFrames.
Embedding a Visio Online task pane within an Excel workbook would be ok provided it can then be rendered in Excel online via Office 365/Sharepoint
Are either or both of these options possible ? I cannot find any relevant samples published to achieve this so pointers would be welcome
Previous response (This applies if you are trying to embed Excel workbook inside of a web-page with cross IFrame communication to refresh data/update the views):
There is no way to programmatically produce Excel embed links. Beyond that you'd need cross Iframe communication via. JS APIs to talk to Excel APIs, which is also not available. Both are under consideration but no defined plan. Please add your ask here
Update
Embedding Visio online taskpane within workbook as a taskpane may work. However, the workbook view/data changes resulting from taskpane interaction would need to take place from background server round-trip, and not through Office-js. Or, the taskpane would need to orchestrate the communication using socket based communication. The experience may not be snappy.

Running a PowerQuery on Google Sheet - keeps failing

I'm trying to run a PowerQuery on a work-related Google Sheet (that I can't share here) so that the data appears in Excel and refreshes when I need it to.
I have published the Google sheet to the web and gotten the link (in web format, not Excel, but this is failing no matter which file format I publish in).
I then go to Data->From Web in Excel and I paste the link to the Google Doc get this:
Query Preview
As you can see, the data isn't appearing. It should be a table with a bunch of data.
Can someone help me fix this?
When using Google's File / Publish to the web pop-up, change the 2nd setting from "Web page" to "Microsoft Excel (.xlsx)". It then builds a link that works without modification in Power Query.
FYI the best in-depth discussion on this topic is on this thread:
http://community.powerbi.com/t5/Integrations-with-Files-and/How-to-connect-google-sheet-to-Power-BI/m-p/205058#M11276
BTW if you have published your Google sheet to the web, then there shouldn't be any obstacle to sharing it here - it's already visible to anyone.

Preview Excel, Word, PDF in Web browser

Except for Google docs is there any technology that will allow me to provide a preview for Excel, Word, PDF from within the browser without having to download & installing anything new (of course I excpect they have at least those porgrams running on their computer)
You can save the files as HTML in Word/Excel. I am pretty sure Acrobat lets you do this with PDF too. You could also automate this process using VBA with Office docs.

Resources