How to import data from XLSX file hosted on SharePoint Online (not lists)? - excel

TL;DR: I'm looking for the equivalent of Excel 2019's Get Data > From File > From Workbook functionality, but where "workbook" is hosted on SharePoint online.
This seems so simple but yet after hours of searching I cannot find anything remotely close. This question does not relate to SharePoint Lists (or file lists). I am literally needing to read data from one online spreadsheet and place into another.
I have three Excel documents hosted on SharePoint Online:
Revenue Tracker.xlsx
Cost Tracker.xlsx
Time Tracker.xlsx
I need to create a fourth file, that analyses the data from the above files, for example to cross-reference revenue against hours.
Based on solutions online, I've tried the following within Excel:
Data > Get Data > From File > From SharePoint Folder
That provided a list of documents located in that SharePoint folder.
Data > Get Data > From Online Services > From SharePoint Online List
Not what I'm looking for.
Create share link in Revenue Tracker.xlsx, then in new file Get Data > From Other Sources > From Web > Paste Url
Error: Access to the resource is forbidden. Even though I am correctly logged into Excel using my work SharePoint credentials.

You can import data from Excel stored in SharePoint to Excel desktop by using Get Data > Web option.
Paste the path to the Excel file in the the URL bar that appears.
EXAMPLE:
https://community.powerbi.com/t5/Desktop/Import-Data-from-an-Excel-sheet-in-SharePoint/td-p/47223

Related

Automatic import of PDF files to the existing SharePoint List

The problem is the following. I have an empty SharePoint List (table) and I want to fulfill it with the particular data from the same to each other PDF files (consisting of tables). Then I want to show the fulfilled data from SharePoint List in PowerBI. I know, that SharePoint List can be connected to the PowerBI and PDF data can be imported there as well.
How to make this process automatic? Is there a possibility to make a macros, which will have an option to upload particular file and import the data, which I need, to the SharePoint List?
Thanks for your feedback in advance!
I tried to upload it directly to PowerBI, but only see the manual solution of fulfilling the table.

Excel - How to connect to another Excel file?

I have a big spreadsheet(Excel file A) which will be updated every month. Also, I created a parametric search in another Excel file(file B) which can pull data from Excel file A. Therefore, Once I send my parametric search Excel file B to my colleagues, they can always pull the fresh data without updating file B (I would need to update file A monthly to keep data fresh)
I tried to connect data by using Microsoft Query/web data. However, I noticed that if I use web data, the source link changes everytime I update the File A. Therefore, the file B connection won't work.
(I uploaded the file A to JIRA as an attachment. I tried to upload to Sharepoint, but Excel does not recognize Excel file on Sharepoint as an Excel file, it recognize as a html file. Therefore, I gave up using sharepoint)
Is there a better way to achieve what I have described above?
Thanks,
Jennifer.
Since you are using SharePoint, choose From File > From SharePoint folder and input the root URL (e.g. https://companyname.sharepoint.com/sites/workspacename/).
This should give you a dialog box like this once you've logged in:
Click on Edit to open the query editor.
You likely only want one particular file in there, so click on Binary in the row that corresponds to the File A that you should have already uploaded to that space. This will import the Excel file.
Click to expand the Table in the row that corresponds to the table that you want to import. This should be the table you keep up to date that gets loaded in.

How to programmatically create a list from an excel spreadsheet in SharePoint 2010?

I want to create a list from an excel spreadsheet in SharePoint 2010. When a new Excel document is uploaded to a SharePoint library, a corresponding list will be created automatically. Is this possible?
You can do this in two phases:
Create an empty MS Access database and import your excel sheet into it (in MS access go to External data -> Excel, choose your file and follow the steps to import it.
When you get the MS access table with the data from excel sheet, right click the table name in Tables section and go to Export -> SharePoint list. There you can specify the url of your SharePoint site and the name of the new list. Click Ok and wait until the list is created and the data is uploaded to SharePoint.
EDIT:
Since this needs to be done automatically (as stated in comments), this is the high overview of the things that needs to be done, with some useful links:
Create Event receiver for the library that the excel files will be uploaded to.
In the ItemAdded Method write the code that will do the following:
Get the uploaded file
Parse the excel file using the OpenXml library
Create the list in the SharePoint site, based on the columns taken from the excel file
Loop through all the rows in the excel file and insert the list item for each excel row.

Creating a Sharepoint Report

I work for a fairly large hospital in their Decision Support Department. We have several tools at our disposal for querying data, but our way of distributing the information could use some work.
We typically run our query and then copy and paste the data into Excel. From there we create graphs and crunch some numbers before sending the Excel file out via email.
We've recently been given access to our own Sharepoint site and so far it looks promising for document distribution. What I'm wondering though is this; what kind of functionality is built into Sharepoint for building reports that run automatically.
It would be great to take a whack of our monthly query to Excel reports and set them up to run automatically via Sharepoint.
I did some reading about Sharepoint lists and that seems promising, but I thought I'd ask here for the best way to go about this - provided it's even possible.
I guess a good first step would be how to create a report in Sharepoint?
I'm going to assume you're using Sharepoint 2013 and Office 2013.
You have a couple options available to you with Excel and Access. Both methods I'll briefly describe can be automated. In either case, you will need Lists, as they can connect to Excel and Access as tables.
For the Excel route, simply choose the "Export to Excel" option in a SharePoint list. This will create an Excel version of your list, but it's more than a static workbook--that workbook retains a one-way link from SharePoint to Excel, so you can refresh the spreadsheet to reflect the most up-to-date version of your SharePoint list. Furthermore, you can link multiple Lists to a single workbook--you'll have to export each list to Excel individually, but each worksheet will still retain its link to its respective list after you consolidate the spreadsheets into a single workbook. You can save this workbook wherever you like, it'll still keep the link. I personally like to set my linked workbooks up with macros that automatically refresh the spreadsheet whenever file is opened, but that's just me. The reason you might consider this option would be to avoid having to recreate the work of creating graphs and whatever other analytics you're doing--you may well be able to set yourself up such that the graphs and analytics pull live from the table that's coming in from SharePoint.
*Do note that changes you make to list data in Excel isn't sent back to SharePoint--this is done to protect your list.
For the the Access route, you can import a list into Access as a table. This option creates a dynamic link to your SharePoint list the same way the Excel option does--the link is one-way and what you do in Access won't be sent back to SharePoint. You can create queries and reports as you normally would after the table is imported.

how to import data from sharepoint to excel using macro

I wanted to know if there's a way to import data from SharePoint to Excel using Macros. What i want to do is have a library in my sharepoint in which i have an excel document. When i download the document and open it, i would like to automatically import the data from sharepoint and have some graphs.
What i've tried to do is export the data of a list using the SharePoint ribbon. Then i opened the file.dll.iqy in notepad, hoping to find the macros to import datas. What i've found was this :
WEB
1
http://win-sharepoint:9090/sites/PPMO/_vti_bin/owssvr.dll?XMLDATA=1&List={C51D70F2-4D7B-4F20-AE05-379DA264F685}&View={8399F350-92C7-4942- B8B0-464A735AFC72}&RowLimit=0&RootFolder=%2fsites%2fPPMO%2fLists%2fStade%20du%20projet
Selection={C51D70F2-4D7B-4F20-AE05-379DA264F685}-{8399F350-92C7-4942-B8B0-464A735AFC72}
EditWebPage=
Formatting=None
PreFormattedTextToColumns=True
ConsecutiveDelimitersAsOne=True
SingleBlockTextImport=False
DisableDateRecognition=False
DisableRedirections=False
SharePointApplication=http://win-sharepoint:9090/sites/PPMO/_vti_bin
SharePointListView={8399F350-92C7-4942-B8B0-464A735AFC72}
SharePointListName={C51D70F2-4D7B-4F20-AE05-379DA264F685}
RootFolder=/sites/PPMO/Lists/Stade du projet
I tried to save it as a macro, but the result i got was not the one expected.
Do you have any idea how to do this ?
Thanks a lot
In Excel 2010, you can go to Data / Get External Data / From Web
Then you can browse to your SharePoint List and select your table using the helpful arrow icons.
Similarly, you can open the iqy file with Excel (enabling security on the prompt) then save the new worksheet. You can see the iqy file details under Data / Connections.

Resources