Excel Connections in Google Drive - excel

I have an Excel 2010 file (.xlsx) with multiple connections to import data from the web. Instead of having to open the file manually and click "Refresh All", I want to use Google Docs (specifically Google Sheets) to automate the refresh process every 60 minutes. I uploaded the xlsx file to my Google Drive but the connections do not work anymore. How do I get around this?
Additional information:
1. The data connections are to Kayak flight search service. Here's an example page. I am importing the table data at the top of the page which shows prices for flexible dates.
2. I tried using IMPORTHTML in Google Sheets but for some reason it doesn't identify the above table as an HTML table. I get a parse error.

I used Kimono to generate this API (you have to sign up to use it) which can return CSV of the form:
"collection1"
"depart-sat.text","depart-sat.href"
"$798","javascript: FilterList.flexFilterToDates('20141213', '20150111', 798)"
"$798","javascript: FilterList.flexFilterToDates('20141213', '20150112', 798)"
...
"collection2"
"depart-sun.text","depart-sun.href"
"$1127","javascript: FilterList.flexFilterToDates('20141214', '20150111', 1127)"
"$1211","javascript: FilterList.flexFilterToDates('20141214', '20150112', 1211)"
...
In Google Spreadsheet you can get the data with =ImportDATA("https://www.kimonolabs.com/api/csv/ccyfjzlm?apikey=YOURAPIKEY").

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).

Code for API in smartsheets on demand batch export

I'm fairly noob on the whole RESTful/SOAP arena, I've been looking around for samples using node.js to trigger a Rest or SOAP API to be able to export a batch of smartsheets to excel
I already got a sample for google drive export but its not quite what I need
I'm not sure how to search for code or samples using microsoft excel export and then batch from a list of files or even a smartsheets workspace
I expect a folder with all the exported excel files in the server at a specified location. I'm also thinking of how this could be done using node-red instead as an alternative, what is the suggested path of least resistance.
You can do a GET Sheet request via the Node.js SDK and have the results returned as an Excel file:
https://smartsheet-platform.github.io/api-docs/?javascript#get-sheet-as-excel-pdf-csv
Note, this requires the Sheet ID and is done as a request for each sheet. There isn't a method to request a batch export of a collection of sheets via the API. You would need to gather a list of Sheet IDs and loop through it to request each one as an Excel file while storing them in your desired location.
You could do a GET Workspace request to get a list of all of the sheets in a workspace for creating your list of Sheet IDs. You could use the List Sheets request to get a list of all of the sheets you have access to as well. Both of those requests are supported by the Node.js SDK.

How to get data from Sharepoint excel datasource to Power BI desktop?

I want to load an excel which is in Share point to Power Bi Desktop.
I have tried loading the sheet by using the data source SharePoint List but failed as its throwing an error. Please help me by suggesting any other way.
Thank you.
I would use Get Data / Web. It will automatically recognize that the target is an Excel file and generate the M functions to interpret it.
The trick can be getting the true link to the SharePoint file - something you can just paste into a browser's address bar so it will download the file directly.
For SharePoint Online, I use Get a Link / Restricted Link, then delete any trailing query parameters after the file name, typically ?d=blabla
That should also work for SharePoint 2016. From memory it was easier in the earlier versions.
I suggest choosing Sharepoint Folder from the Get Data menu.
Then you need to enter the site's (or subsite) root url (not the direct link to the excel file)
For example, you would connect to.
https://yourcompany.sharepoint.com/training/
Instead of the full address.
https://yourcompany.sharepoint.com/:x:/r/training/_layouts/19/Doc.aspx?sourcedoc=%2asdfasdfasdfasdf%7D&action=default&uid=%7asdfasdfasdf-4662-A7A5-asdfasdf%7D&ListItemId=2&ListId=%7asdfasdfasdfa3443445&env=prod
Then press Edit to reveal all of the documents stored at that root. By clicking the binary link, the query editor will reveal the contents of the file. Then select the tab you're interested in loading by selecting the Table under the data column.
Steps to get the data from sharepoint to Power BI:
Select the File available to share pont
Click on three dots
Go to Open-> Open in app
In app, click on File -> Info -> Copy Path
Open Power BI, New Source-> Web
Add URL, delete (data with and after ?)

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

Import Data into Spreadsheet - Refresh Automatically

I would like to import data into a Google Document each day automatically without having to do it manually. I have about 50 numbers I need to import, each from a different page. One looks like this: http://www.alexa.com/siteinfo/sweatingthebigstuff.com
I want the 244,604 imported into my document and to refresh automatically. Once I get the code for doing it once, I'll be able to repeat it for the other information too.
Any ideas?
Google Spreadsheets has developer APIs for .NET, Java, PHP and Python. So just screen-scrape the Alexa page and update the document via the API, in the language of your choice.

Resources