How can I load edge and get info from a text file in VBA? - excel

I’m currently trying to write a macro to pull information from a website and then display it in a worksheet. So far, I have code that will open Edge and navigate to the required URL. The user has to login using their CAC certificate, and then it goes to the correct page.
Dim browser
browser = Shell(EDGE_PATH & URL, 1)
Once the page is loaded, it submits the form which creates a new window with a text file that has the needed information. I need to get the information from that text file, but I’m not sure how to do it with VBA or shell. If it’s even possible. I know of Selenium, but I can’t use that in this environment.
Does anyone know of a way to do this? Any information would be appreciated.

Related

Exporting WebBrowser to PDF with userform or in spreadsheet

I am implementing a feature to my excel-program that will show me a map (from google maps) of some coordinates. The idea is to be able to export this map with other pages to PDF. It looks like I have two options:
1) Inserting a ActiveX "Microsoft Web-Browser" directly in to the worksheet and then having excel export said worksheet to a PDF.
2) Inserting a ActiveX "Microsoft Web-Browser" in a userform.
My problem for 1) is that it doesn't seem to work for newer version of excel (2013>), but it does work for Excel 2007.
The problem with 2) is that it is hard to export a userform to PDF when you also want 2 different pages from the workbook in the same PDF (I do not know if userform1.printform has that feature).
My question is if there is either a way to insert a Web-Browser directly in Excel, for all versions of excel, or a way for a macro to export both worksheets and userform in the same PDF.
I suggest the legal way number 3) Using the Google Maps Static API to download a map as image to a temporary folder and import that image (dynamically) into your Excel file. Then you can export that Excel file to PDF as usual.
The Maps Static API service creates your map based on URL parameters sent through a standard HTTP request and returns the map as an image you can display on your web page.
This means you can download the image file through a standard HTTP request to your computer and place it into Excel.
I'm pretty sure the ways you try to automate it is against Google's terms of use because automated access of Google's services without using the official API is probably not allowed, no matter if private or commerial use (you might get banned).

DataTables export to excel

I'm currently working on a project (developed using laravel, php, javascript, jquery, html), containing a large amount of data, so I'm using DataTables to display them with serverside set to true. What I'm trying to figure out is how to export the complete table to an excel file - right now it only saves one page (the one being shown at that very moment ) - using the Button extention.
I've been reading about it for a while now but still can't figure out a way to do this. I understand that, since serverside is set to true,
the only rows that exist on the client-side are those shown in the table at any one time.
But how can I get the complete table? Any help would be appreciated!
UPDATE:
So I create the excel file with the data I want in the backend, using PHPExcel, but now the problem is that it is saved server-side, while I wanna make it downloadable (client-side). From what I've been reading, I must add the appropriate headers to do so, but nothing I've tried works. Using
this, I managed to output the data of the excel in the screen, but it just shows gibberish... I should probably also mention that I'm new at this!

hyperlink in excel doesn't load properly, but from PDF or word loads fine

We have a Business Objects (BO) report, that formats a hyperlink to the front-end application for a particular entry; so that you can go straight to the data entry screens for that record in the report.
Link works properly from Business Objects in the browser.
Link works properly from a Word document saved from BO.
Link works properly from a PDF document saved from BO.
Opening the XLS file in OpenOffice Calc, links work fine.
Opening the XLS in Excel and the links fail, with an error message from the application as if the security was timed-out or the user hasn't logged into the application properly. (Which doesn't happen for any of the other non-browser based applications, if the application is open in another tab and the user is signed in.)
When the URL parts are copied out of any of the formats/applications, they match exactly. The application redirects to the error message page, so I can't say for certain what URL hits the browser from Excel, only the results. The other applications end up at the page listed in the href attribute.
Is there anything that can be done to alter the href part of the link, so that it works from Excel? (As a sub-question, any hints as to why Excel's hyperlink behavior is different from the other MS Office apps would be appreciated.)
My Google-Fu isn't strong enough with this one, most of what I've found with the keywords I've tried have been directions on how to link from Excel, not troubleshoot failed outcomes of an otherwise valid hyperlink.
Link general form (in case that matters): https://server.domain.com/path/page?parameters=uniqueID
Try changing the cell format to text. It has worked for me in the past when hyperlinks fail to work.

Excel 2007 Refresh Imported CSV File From Web

Log data from a test is uploaded to a web service, and the processed CSV is downloaded back into Excel for viewing in charts. At the moment, this is done via copy and paste for short CSV files and the Data > From Text feature for larger CSV files. Unfortunately, this takes a bunch of time for every test, and I need to make the process very simple for someone else to update the Excel spreadsheet.
The Excel spreadsheet contains 5 raw-data pages which are used to store the CSV from the server. I have no issues selecting Data > From Text, entering the website URL, and completing the format to import. This process can be repeated (same as the Copy and Paste) for all 5 pages to import the data.
This process only allows me to put in one filename, so I am using the same URL for the data, and having PHP return the CSV of the latest (or a specifically configured) test whenever the website is accessed. I've verified that this process is working correctly.
Unfortunately, when I do 'Refresh All', it prompts for a filename unless I go to Data > Connections > Properties, and uncheck 'Prompt for file name on refresh'.
However, even when I do that, I'm getting mixed results. Sometimes only one of the pages will update. (Seems to be the last one I set up.) Sometimes none of them do. I need a solution which updates all 5 pages based on the current CSV from the server without having to set up the connections again every time. Ideally I'd like to just hide these raw data sheets so we can have an Excel file that's just the final charts.
Surely this is a common function and I am doing something wrong, yet all the guides I try on the Internet don't seem to work. For example, this one:
http://www.kimgentes.com/worshiptech-web-tools-page/2010/8/18/web-connecting-csv-files-as-external-data-to-excel-spreadshe.html [URL is corrected]
Seems like they only set up one connection. I can get one working to refresh, but not more than one.
I have seen this happen and finally figured it out. There are actually 3 things that can happen to give this result, and a separate solution for each:
First, Excel software uses the IE 11 web object to when it does web
retrieval of data. This means it will be "sticky" to sessions using
IE11 to access the data. Most websites these days are run by cloud
servers, which generate sessions on the server with the most load.
This normally has no impact on users on web browsers since they
login and can visually enter their credentials etc. But when a
program accesses a website and must use a specific web browser, it
must use the properties of that browser and how it works. I ran into
this a lot when I would generate and be able to download my CSV
files on the website in Chrome, then try to use Excel to import the
same files wouldn't work (it would say they weren't there). The
solution to this, at least for now, is to use IE 11, login to the
website, generate the CSV files and test that they can be
downloaded. Then use Excel to run the web import and it should pick
up the same sticky session to get the CSV files.
Second, password entry is a different thing, but also has to do with the stickiness
of the data. For some reason Excel will not cache your credential
responses for logging into a website without you entering them 3
times. This experience may change for you, but I found that I must
enter a new credential set (for a new web import of a CSV) 3 times
before it becomes permanently cached by Excel. After this, I don't
have the problem.
Third, most complex Excel programs that require
web import may also require that you either import local data you
downloaded from a website, import data from a website into a sheet
or run more complex objects like Macros. All of these need proper
permissions. You may need to set your Trust Center settings to allow
you to use your Excel program on your computer in this way. That is
part of MS office. You can set add and update those as per MS info
here:
https://support.microsoft.com/en-us/office/add-remove-or-change-a-trusted-location-7ee1cdc2-483e-4cbb-bcb3-4e7c67147fb4

How do I load all the data from a webpage with Qliksense?

So what I want do do is, get the all the data from this webpage http://abreview.ru/stat/aeb/ on QlikSense Desktop.
My Attempt
I tried to do this in data load editor through web file as a connection, but it only loaded a part of the data (part that can be seen without chaining the data filters when the webpage is first loaded)
So, how do I can the full amount of data be loaded, what are some good ways of doing this.
I could copy the data into excel file and then load it through excel but it is a lot of algorithmic work and I want to find an efficient solution, that is if there is one.
Great question, I've done this as a step by step process as I've never done this before either.
To connect to the website, you need to open the data load editor.
On the right hand side you need to "create new connection"
You then enter the URL and name it
Once this is created, the connection will appear on the right, click the select data icon.
You then need to pick the table you want to load, I'm assuming you want the fifth one.
Then click insert script and load data.
You can then get on with creating your apps.

Resources