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

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,

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.

Reading data from shared teams text file using VBA in Excel

I have created a tool using VBA that performs several pulls from BigQuery and does a variety of transformations and summarization inside of Excel. The tool is an evolving tool and to make sure that the users are using the most current version of the tool, I would like to have a version file saved on the shared Teams page that the tool would check and if needed, download the newest version onto the tool to the user's folder. I have scrubbed the web for several solutions to this ask but not one that actually works. Below are the links to the solutions I have attempted. The issue is that the connectors for opening text files seem to not work with a URL from Teams. I need to know how to make this work. Any help would be greatly appreciated.
https://www.excel-easy.com/vba/examples/read-data-from-text-file.html
This solution doesn't seem to work with a URL as I get a Bad Filename error.
https://chandoo.org/forum/threads/download-file-from-sharepoint-and-save-it-in-system-folder.41779/
Problem with this one is that the download for some reason shows completed but actually never moves local.
Connecting to Excel file stored on SharePoint via ADODB
https://www.connectionstrings.com/textfile/
I attempted to use this solution using the text file connection string but was not successful here either.
https://www.exceltip.com/import-and-export-in-vba/import-data-from-a-text-file-ado-using-vba-in-microsoft-excel.html
Again, another bad name error.
Any help or advice on how to connect to a simple text file shared in a Teams folder would be greatly appreciated.

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?

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.

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

Resources