Updating a sharepoint list from Excel - excel

I know this is a little backwards, but unfortunately this is what I have to do based on what I have to work with. Essentially we are getting data from one place, putting it into Excel and then running some pivot tables and then copying and pasting the results to Sharepoint. There is no way of getting the data into SharePoint from its initial source.
So here are the steps I have to do on a daily basis:
Go into 3 lists on sharepoint and delete the current data in there
Copy the data from each excel table and then paste it into the associated SharePoint list
Go into the Titles, etc part of SharePoint and update the file name to append the current date to it(ie change it from Data05032017 to Data 05042017)
I would like a way of automating this on a daily basis from Excel by simply pressing a button via VBA or if there is a way I can accomplish this wia linking somehow that would work too(not sure if its possible, I know you can link from SharePoint to Excel but unsure if you can go in the reverse direction).
So I first would like to know if this is possible and then if it is, how I go about doing it.

Related

Update Sharepoint-List with with excel-file using power automate

I'm using PowerApps to modify a list (list A) in Sharepoint. Some of the data displayed in this list is from another list (list B), displayed using lookup. Every week I update list B, with data I get from a automated email. The email contain a excel spreadsheet.
I would like to automate this, but I've run into so many issues I'm not even sure it is possible anymore.
This is my flow:
To my knowledge, it isn't possible to update a list directly from a excel file, unless the excel file is formatted as a table. Instead I have a empty file on my sharepoint that I update, which I later try to use as the source for updating list B.
Sadly this file is either locked by myself, or it won't recognize my table.
Any solutions to solve this problem would be helpful!
Just insert a create table step into the flow.
So you will:
Receive an email with the new Excel file.
Save that temporarily in a secured spot.
Create table on the data required.
Use the table to update the SharePoint list.
I've done that, then I've taken the data listed and added it to a SharePoint list using sample data from a website about single board computers, here:

Create Excel metadata using VBA to filter in sharepoint

I am trying to use metadata from an Excel file to use for filtering in our sharepoint libraby.
The excel file already contains dropdown menus to pick certain values from, which are then used to create a very lengthy filename. However for our new sharepoint libraby I would like to move those to metadata, so it can be made visible in sharepoint columns and users can filter.
The file is a template that should be filled by users and when ready saved after choosing certain values.
The creation of the filename is done in VBA and therefore all values I want to use are available there.
I've tried a number of approaches I found in forums using e.g. customdocumentproperties and made it work...sometimes... While it worked in the beginning, I cannot make it work now.
It seems changing the metadata is a problem. Creating the metadata fields for the first time worked, but then changing it, did not. I have the feeling I do not understand some basics on this action. Microsoft websites are not of any help here...
What is the best - flawless - way to use VBA to create, add, change metadata in the excel-file that can be made visiblle in the sharepoint library? And are there any typical problems?

Copy and paste Excel rows between two workbooks based on criteria from exported Access data

I have no previous experience in Access, VBA coding or in Excel macros prior to teaching myself the past month via these forums. Thank you forums and contributors. I have enjoyed my Access learnings so far, the challenge that it has provided and appreciate any help that I can get. As such, the code and methods that I have used to this point may well be convoluted and confusing. I will do my best to provide relevant details and accurate terminology.
I work in a lab and I am creating an Access Form for semi-automated reporting. Samples are received from clients and are logged into the Excel Table R&D Log. The worksheet is InProcess. Samples are sorted based on the site in which they originate and given a one or two letter site code (G, D, WH, etc.) and an ID "yy-000" in separate Excel columns (i.e. D 18-096). Samples may be submitted for multiple analyses (Metals, Water, Soil, etc.) and may even have multiple rows of reporting if multiple analytes are identified in the sample. There are several other columns, such as receipt date, reporting date, units, etc. Once samples are reported, I manually copy and paste them into the Archived worksheet, and delete the record and blank row from the InProcess worksheet. Since one sample may have multiple analyses and even more potential results, each record would be reported on a new Excel row (with the same D 18-096 ID number). Thus, there is not a single unique identifier or primary key for each sample in the current format. R&D Log is updated manually by lab technicians and the worksheet InProcess is a linked table in an Access Database.
The Access Database is using two combo boxes on a Form frmInProcess to filter a Query qryInProcess of the linked table. The combo boxes are filtering the report destination (one client may receive multiple site codes) and the analysis (reports are separated based on type of analysis). The Query is also filtering out blank results and blank dates, so only completed samples will appear on the filtered Form. I have generated VBA code to this point that will export the Form to a .pdf, save the file with unique filename, and open outlook to mail out the report. I have also managed to export the filtered Form frmInProcess to an Excel file Access Test (not the linked file).
What I would like to do now is to automate the transfer of completed test results from the Excel worksheet R&D Log: InProcess to R&D Log: Archived and delete the record from the InProcess worksheet. I am not sure if I can export the filtered Form into a linked Excel table, or if I must use a separate Excel file (or if it even matters for simplicity of code?). I would now like to read the exported filtered Form in Excel Access Test, lookup matching rows in R&D Log based on several criteria (site, ID, Analysis, Analyte, Report Date) and automate the transfer of records between R&D Log worksheets. End result being that Access generates reports for completed tests, and the records are removed from InProcess testing and transferred to Archived testing in Excel. I am guessing that I may need to close the Access application and perform this in Excel. Hope this is easy enough to follow.
Thank you.
In my experience, importing an Excel document into a temporary NEW (or totally empty) Access table is usually the easiest way to go. Then you do not have to worry about cell references like you do in Excel VBA. Even if the Excel document has old data in it with just a few new changes each time, importing it into a temporary Access table could be the simplest way to go, because then you can compare the data in this table with the data in another, permanent Access table and update the latter based on the former.
As far as the original Excel file, if you need to delete rows there, it might be quicker to export a new Excel file with just the data the old one is supposed to end up with, and then use VBA to delete (or - safer! - rename) the old file.
So the development process goes something like this:
Save import steps by first importing an Excel file via Access' ribbon options "External Data" (tab) ->"Excel" and when you finish, be sure to check the "Save import steps" box and note the name you give the "saved import" because you will need that in your VBA code.
In Access, write a function for deleting the table. The VBA code is:
Const cTable = "MyExcelTempTable"
If TableExists(cTable) Then
DoCmd.DeleteObject acTable, cTable
End If
Now you can test your delete function on the data you imported.
Write VBA code to import the same spreadsheet to create the same table:
Const cSavedImport = "Import-MyExcelTempTable"
' Import the Excel file
DoCmd.RunSavedImportExport cSavedImport
Write more VBA function(s) to check the imported table for bad data and then to copy it into the permanent table. You might be updating existing records or adding new ones. Either way, you could use Access queries or SQL to do this and run them from VBA.
Write a VBA function to rename the old Excel file. (You could use an InputBox if the Excel file name is different each time. I do this for importing Excel files, and I set a default value so I do not have to type as much.)
Write a VBA function to export the new version of the Excel file.
Make yourself a button on a form that, when clicked, runs a VBA function. Inside that function, run Steps 2 through 6, above.
I am not sure my answer exactly matches what you are trying to do, but hopefully you get enough of a picture of the workflow to figure out the details of what you need.

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.

Edit Excel table data in SharePoint using forms

I have an Excel table with data but here the rows and columns each have meaning, for example:
ColHead1 ColHead2 ColHead3
RowHead1 Data11 Data12 Data13
RowHead2 Data21 etc. etc.
RowHead3
I would like users to edit the data using SharePoint forms.
I've considered the following options
Flatten the data and manually add editors for each field onto the form (so that I can simulate some sort of grid layout). This may become unmanageable if I need to make a change though.
Insert the data into a list and let SharePoint create a default form, but this will also flatten the data.
Is it possible to somehow use the data in SharePoint directly in a List (or lists) without flattening?
Or should I just post the Excel sheets for direct editing in SharePoint?
You are right. 2-D data cannot be handled by SharePoint.
The best solution here would be to use Excel Services.
In 2007, Excel Services did not allow to write changes to backend file. I am not sure if the situation has changed with SharePoint 2010. You might have to check it out.
You can also put Excel file in document library itself.
However, what I am missing here are the business objectives for this requirement. What essentially do you want to achieve by putting this data in SharePoint forms ? May be there is some better way which others will be able to suggest if they know actual requirements.

Resources