Automatically Refresh Excel Data Connections - excel

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!

Related

Refresh excel linked file when SQL Server data table changes

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.

Tableau live changes replication

Suppose i have a dashboard in my local system, and the same dashboard as web service, can we see the live changes in web dashboard if we apply some filter in the local version.
Is there such option?
If you are working off a truly local copy of the workbook, then any changes you make to that workbook will not be reflected in the server based version. Similar to working on a Office file with another copy on SharePoint, changes you make local do not sync to different physical copies of the file.
A couple possible solutions
You can use the web-based edit functionality of Tableau Server to make changes to a server-hosted version that are seen by all users
Any edits to the data source are "seen" by Tableau at the time of the data query, so any filtering you apply to the data source will get picked up any time the Tableau desktop/server engine queries the data source. This also applies to any saved data sources you are publishing on Tableau Server (which can be used by workbooks both on Tableau Server and Tableau Desktop). Note that if you are using TWBX files, those are by design self-contained and won't pick up upstream data changes without a manual refresh.

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

Refreshing Excel Data connection on a Windows Server

I am running an automated Data job on a windows server that outputs a SAS dataset everyday. On top of this, I have an Excel Report connected via Excel's Local Data Provider.
My problem is, that the Data Connection needs to be manually refreshed by a person with SAS installed on their PC. I have tried writing a piece of SAS code that opens the Excel file on the server and then triggers a piece of VBA that did the refreshing, before closing and saving. This works perfectly if I'm logged into the server. But it doesn't seem to work if nobody's signed in. I believe this has something to do with having an active user session.
UPDATE
The process that I use to connect to a local data source from Excel, looks like this:
Data Connection Wizard
Select SAS Local Data Provider from OLE DB Providers
Add the Route to my SAS Dataset as data source
Select My source table and create a Pivot Report
Is there any way to do something like this?
When you want to run Excel unattended, thus no interactive user is logged on, you can do this with a Windows service. You have to ensure some settings for Excel, as well as it is important how you start excel.
Be aware of Microsoft does not support, or even suggest you to do something like this. Excel is a client software, it is exactly the opposite of a piece of software that is easy to maintain running as as service. Read this excellent article Considerations for server-side Automation of Office about the topic. Even when a little old (talking about Office 2003) it is still state of the art.
Please consider these conditions:
You cannot use the System or Network account, you have to let the windows service running under an account that at least have excel started once. This cannot be done with the named ones (as they cannot be used as interactive users)
Excel has to be opened at least once with the user under with the windows service account will run. You'll have to configure dcom settings, open vba once to initialize it, and most probably set some settings like "trust vba model" to be able to programmatically access Excel
last but not least when starting Excel you have to start it with loading the user profile. The Process.Start method in c# allows exactly that by just setting a boolean value to true.
Doing it like this, Excel should just start fine and update data connection with the VBA.
You may want to implement that windows service in c#, as it is really easy, have a look: Creating a Basic Windows Service in C#.
When using c#, be aware of you have to correctly dispose interop objects, pretty good described in How to properly clean up Excel interop objects

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