Refresh excel linked file when SQL Server data table changes - excel

I have an excel file which is linked to a SQL Server table using an External data connection. This table is refreshed weekly by an upstream process. For some reason, our users are unable to refresh the data by themselves since they run into authentication issues even though the password is saved and embedded in the file. They want me to email the file each week after the data is refreshed.
Currently, the table is refreshed via an SSIS process. I could use an Email Task and send the file as an attachment.
IS there a way that I can automatically refresh the file without opening or any other manual intervention at the time of execution?
I looked at some of the other solutions that have been posted online but most of them have the source data in a separate tab. Our data is external.

You can set spreadsheets to refresh automatically on a schedule using powerpivot and sharepoint.
https://support.office.com/en-us/article/manage-a-data-refresh-schedule-218448bc-24fa-4729-a28e-3ce5ef003e95
it creates a sql server agent job in the background to do the refresh from what I remember when I set this up at my last job, so you could tie it in to SSIS as a next step after it runs on the agent job. All sharepoint files can be picked up using windows explorer, so you could get it from it's file path there to email it out. Or you could just give them the sharepoint link, but now it will always be up to date.

Related

Data not Refreshing on Excel Online

I have an Excel file on SharePoint with data from an external data source (SQL Server). I want to setup an Office script to automate the refresh of the data and then trigger it via power automate. However, i am unable to get the data refreshed (even using the manual Refresh All button in Excel Online). It doesn't give any errors in the UI, shows as refreshing, but nothing changes.
I can refresh the data when i open in the Excel desktop app.
Any help on where should i check to get the data refreshed via Excel Online as well would be greatly appreciated?
TIA !

Automatically Refresh Excel Data Connections

I have a data file that has two Microsoft Query Connection Queries that pull data from an outside source. My goal is for these connections to update automatically within my local Microsoft Excel application. I have uploaded this Excel file on to the online version of Microsoft Excel, thus when it updates automatically in my local Microsoft Excel version, it will update the online version.
This refresh needs to be done independent of use of the system, meaning that no person will need to open the file or refresh the file, the local Excel version needs to not be opened by a person, but could be by some sort of code.
I have tried using the automatic refresh after [x] minutes, but that will only update when I open my local version AND that amount of time has passed. I do not want to have to open the local data source, because the eventual goal is to have a separate system that will update this in the background, that I do not manage at all.
If you have any advice on how to make this work, that would be great!

Refreshable pivot table connected to an external source

I am planning to deploy an Excel file where the users would only need to refresh to see the updated data. I can currently do this by sending out a new Excel file every time.
What I have:
Office 365
MariaDB on Digital Ocean
What I want:
Create a pivot table/data model connected to the database and have the data updated real time upon refresh.
I can do this on my own via ODBC but when sharing the file, it asks for the credentials which is saved on my ODBC file. Ideally, I don't want to share the credentials even though it's read-only.
Is there an alternative to ODBC so I can easily share the refreshable pivot table?

SQL Server and Excel

I want to link an excel file to SQL Server 2014 whereby I can edit the file and the data gets updated on the server automatically.
Similar to what happens when you link sql server to Access whereas you can edit the data and the changes take effect in the server.
Thanks in advance
There is no out of the box solution for this. You can do this either of two ways:
Write a C# code which has a file watcher attached to the Excel file which uploads the Excel file using SSIS job to the database.
Create a scheduled SSIS job which imports the Excel file periodically.
Understanding the purpose would allow for greater elaboration.
This depends on the type of data you wish to edit.
For master data, if you have the Enterprise or Business Intelligence edition of SQL Server and Master Data Services set up, there is a plug-in for Excel:
https://msdn.microsoft.com/en-us/library/hh231024(v=sql.120).aspx
For transactional data, I would strongly advise against using Excel as a front-end and would recommend you to consider alternatives.
However, if you are compelled to go down this route, you can achieve this using VBA scripting and linking via a DAL (Data Access Layer) such as ADO.NET. Be aware that giving such power to your users could open up your system to sql injection attacks - only proceed so if you trust the users 100%. Another thing to take into consideration is validation checks - validation checks should be applied to every cell where data can be entered. More information can be found here:
https://support.microsoft.com/en-us/kb/316934

Sharepoint - Link to a file that is updated Dynamically?

I'm hoping this is possible.
The organization I work for has a Sharepoint site and I am able to Upload Files to pages, however I am not an admin on our Sharepoint. I'm not sure what the version is, I think its older (ie: 2005).
I have some Excel Reports I've built. The data for these reports is pulled from a SQL Server Database which I have full control over. I have setup a Job in SQL Server to run every 12 minutes, this procedure pulls in some data and updates a few tables. These tables are used to feed my Excel Reports.
I have a separate Scheduled task set to open my excel report(s) refresh the data connections and save as a PDF.
I would like to link to these PDF Files via our Sharepoint so that the VIPs can access the reports as they want, but they always see the most up to date report.
I was trying to link to a Shortcut to the PDF Files but SharePoint doesn't seem to like that. How do I make the SharePoint link point to the PDF File that is saved over every 15 minutes?
Thanks in advance,
Any insight is greatly appreciated.
The way I do it (newish version of Sharepoint) is make the save location for the PDF the network location where Sharepoint keeps the files for that site. Usually you'll have access to those if you can edit the Sharepoint site.
Here is a tutorial to find that network location.
EDIT: It very well may be disabled by the admin at the moment. But it looks like the functionality is there.
Given the age of your SharePoint (either 03 or 07), most of the modern tools that you could use to do this don't exist for you (Excel reporting, BI tools, etc). The easiest solution I can think of is to actually modify the other side of the equation. A few options:
Change your report to output two copies of the same file. One entitled (as an example) currentreport.xls and the other report20150626.xls . Put the link to the currentreport.xls in SharePoint.
Build an ASP.net page that runs the SQL query you have built and pull the data through a view. Since this would be pulled on demand, it may be a few more cycles of your SQL code, but indexing, caching and selective data pull can prevent this from being an issue. Put the asp.net code in an iFrame in a SharePoint content editor web part.
Build your report using SSRS and host the output of that in SharePoint using an iFrame.
Run a scheduled job in SQL that copies your current report data to a table and query that table instead of your normal report table. That way you only have one Excel file that points to a specific table so no need to update links. You can always keep copying data to specific files if you need a historical record and can't use the DB to store this data for you (though the amount of space that it would take to do so would be minimal).

Resources