Excel VBA: Web scraping now IE11 is nearly obsolete - excel

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?

Related

Fetch values from HTML files to Excel sheet

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.

Losing protected ranges when downloading excel from sheets and sheets to excel

I have been using excel documents containing protected ranges and hidden sheets, it seems like this can be circum navigated by importing into google sheets and likewise when doing the same in google sheets the functionality is lost when downloading as excel.
I understand the principles behind why this happens but I am curious as to whether there is any way of keeping this functionality?
I am afraid it is not possible since both are different technologies. Microsoft's protection works with the file itself while Google's protection checks the permissions from each Google account.
Not long ago Google added a compatibility mode for office files so you don't have to convert the files to Google Docs to open them, however this view still has limited features and it is not possible to work with the same type of protection in both platforms.
Reference:
Work with Microsoft Office files
Edit Office files

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,

Excel services snapshot removes page breaks

I am using Sharepoint Excel services to produce reports, and noticed that when users download their excel services workbooks as a snapshot, any page breaks set up in the original spreadsheet are lost. I cant seem to find any mention of this problem in any sharepoint forums or microsoft, just wondering if anyone else has experienced this or even has a solution? Thanks
A lot of information and functions of the workbook are not available in Excel Services.
Also the Snapshot does not "remember" such settings like page break or in my case landscape orientation for printing.
Here are some references for what is supported and what is not supported:
Snapshot:
https://support.office.com/en-us/article/Open-a-workbook-or-snapshot-in-Excel-from-Excel-Services-0d7c0465-6ea9-4a1e-993b-54bd1099d604
Difference Excel / Services
https://support.office.com/en-us/article/Differences-between-using-a-workbook-in-Excel-and-Excel-Services-b690ef8c-a26a-4673-b426-1852f8d77fd0

Use Excel for calculations in web app

I've inherited a large Excel spreadsheet that does some financial calculation magic using any number of simulation tables, and have been asked to write a web application as a front end. Now I could spend endless hours trying to figure out the sheet, or I could call the excel sheet from my web app. I seem to need the Office Primary Interop Assemblies, but do I also need to install office/excel on the web server? How can I handle multiple simultaneous requests to the same sheet? Is this approach even possible?
We have implement a project where we call several Excel spreadsheets from a web app.
We use Sharepoint Excel Services to do this. It has worked very well for us.
In our case our largest spreadsheet has over 300 input parameters, 1000 formuals and 50 results. This takes about 0.5 seconds, where most of that time is moving data in and out of excel services via a web service.
The main draw back in using Sharepoint Excel Services is the cost. However, in our case the saving in development time far out weighed the cost.
Excel is a desktop Application (and a very good one) and not designed for either multiple users or deployment in a web application. You might be able to cobble something together but you are likely to have to write a lot of code to manage the design features of a desktop app which are inadequacies in a web app.
You are better off trying to understand what the Excel workbook is doing and simulating it in code with the desired multi-user features in mind which must have been beneath the request for a web app. If you have access to the current users and/or author you should be able to document the requirement and you have the Excel workbook for you to test your algorithm against once you have understood it.
Best of luck.
Take a look at SpreadsheetGear. Ordinarily it is used to generate new spreadsheets, but it has a calculation engine for existing spreadsheets too. And unlike Excel, it was designed for a server environment.
Spreadsheet Gear
You can try SmartXLS for .net,it has a calculation engine for Excel workbook,it does not depend on Excel.
Not sure if this is appropriate to your task, but could you not import it into Google Spreadsheets to make it multi-user? If it is really complicated then I shouldn't think this will work, but might be worth a try.

Resources