Stop updating PowerPivot when opening Worksheet - excel

I have an excel workbook that is to be used as a report, that is distributed to different people. The workbook gets data from an input file (another Excel file) that is not available to all the people who are receiving the report.
My problem is, that when the people who does not have access to the input file opens the report, the workbook tries to update the data, but fails, as the user does not have access to the input file. Is there a way to stop the sheet from auto-updating when it is opened?

Based on the versions of excel I have used, Excel 2013 and 2016 that does not sound like the standard behavior I have seen.
There would be a couple things to check:
1) Is there macros in the file, which run on open and force refresh. VBA command to refresh a data model being the following ThisWorkbook.Model.Refresh
2) Right click on the pivot tables --> Pivot table settings --> Data, check if refresh data when opening the file is selected. Not sure on this one but it might be forcing a refresh of the model.
3) If you are using power query, open the queries & connection tab, right click each query and select properties. There is an option for Refresh data when opening the file.

Related

How to Get Data on Close Workbook Table on Excel VBA without Openning It?

I have three Workbook,
First is for my Inventory System for Admin,
Second is my Inventory System for Employees, and
Third is my Database.
Does anyone know how to get Data Table on Database without Opening it and put it either in Admin or Employee's Inventory System?
All you need to do is go to "Data" tab in ribbon > Get Data > From File > From Workbook. Then open the "Database" excel file.
This will allows you to preview the data from the "Database" sheet. If you don't need to make any changes you can click load directly and the data will be copied.
You can check out this video for more examples on how to use Power query.
I also recommend checking out this video on how Power Query can help you.

VBScript to dimsiss Excel warning dialog about external data sources?

I have an Excel file that's linked to a SQL database view. The Excel file needs some monthly massaging that I am trying to do with a VBScript but this dialog box keeps coming up and interrupting my VBScript:
This workbook contains links to one or more external sources that could be unsafe.
If you trust the links, update them to get the latest data. Otherwise, you can keep working with the data you have.
And buttons for Update, Don't Update and Help
I do trust the data (it's our on-site SQL server), I don't want to refresh the data with this specific script (it takes about 15 minutes and it is refreshed via another process). But the dialog box is holding up my whole VBScript, how do I dismiss it? I've tried ExcelObj.DisplayAlerts = False and ExcelObj.EnableEvents = False but neither is making this dialog box go away. Please help!

Save logfile within Excel file using VBA

I am trying to develop a manner in VBA to track changes in a document without having to hide the contents in an extra sheet within a workbook.
I understand that if you change the extension of an Excel file to ".zip", you can access the Excel document as components sorted into directories. Is there a way to save and write to a text file within one of these directories so that I can access it every time the document is opened, without having to have the user drag a log file along with the Excel document?
Some facts:
When Excel opens the file, the file is blocked by Excel. There is no possibility to write to that file within VBA
You can store additional data into that file externally or after the Excel workbook has been closed
You would need to have code externally from the workbook to accomplish writing to that file after it has been closed. You may want to use VSTO or an oldschool Excel Addin.
you have to ensure that Excel will not destroy your changes when restructuring or repairing the file.
In the first run, your idea sounds very natural, to not use sheets from a programmer's point of view. You only have full control on Excel files when
you use external libraries (e.g. Spreadsheet Gear) or
you remote control Excel via automation.
you use openxml SDK for Excel
you use VBA
You could insert additonal information and take care that this information is not skipped by Excel.
When you want to do the tracking this way, I would suggest you to use an Excel Addin. There is actually no need for installation when using this kind of Addin. Attach to open workbook and close workbook events and ensure that all changes are written to the Excel Workbook after it has been closed. Certainly you would have to attach to all kind of other events to track all changes to the workbook. You may need to have in mind that there can be more than one workbook opened at a time.
Actually there are alternatives.
write your logging code in VBA or whatever fits
abstract away how your persist the code (e.g. use a data provider)
think about these two alternatives to store logging data:
You can save logging data in cells of excel. When using a "newer" version of excel, you have a limit of 1 million rows. You may want to implement a rolling mechanism that ensures that you never go over the border of 1 million records. (you may be dont want to track a million changes)
You can use the document properties to store you information as xml.
Last but not least, the most obvious: Why not using Excel's functionality of tracking changes? Understand track changes in Excel 2013

Excel - updating a worksheet from a SSRS scheduled report datasource

I have tried the various different methods that Excel offers to work with external data.
I have inherited a system in work that involves copy and pasting data from one SSRS report into a pretty complex Excel workbook. I want to automate this system, but for the time being I still have to work with the Excel file.
This Excel file needs to be updated daily - I want to schedule the SSRS report using Windows File Sharing; have it run every day and have the Excel workbook look at the report each time the spreadsheet is opened, updating (adding data to) various tables and cells with the values in the report.
I'm finding this process really unstable. It will work for some reports, but not others. Any pivot charts based on the connection will lose their data and formatting if the sheets cannot link to each other. On opening the main, destination excel file, I get errors about links not being updated, etc. Browsing for the file and reconnecting it works, but this defeats the object.
Could the be something integral to these set up working every time that I might be missing, or does Excel have a feature that better suits what I'm trying to do?
Many thanks for your help!
I'm using SQL Server 2005, Excel 2013 and the reports and datasheet are stored in a shared folder
I think you are heading down a dead-end. You will never have enough control over the rendered output from SSRS and any solution will be fragile.
I assume the SSRS data source is SQL or some other source that Excel can read. I would take the Dataset code from the SSRS report and implement it as Data tables in Excel, e.g. Data ribbon / Get External Data.
In the simplest implementation, each query just populates an Excel Table. You can set the connection definitions to auto-refresh on open.
For more complex requirements you can build an Analysis Model in Excel using the Power Pivot Add-In (included (but not enabled) with Excel 2013). This lets you relate datasets to each other and add calculations etc. The gotcha here is that you cant auto-refresh without SharePoint.

Refresh Power Pivot Window

How to automatically Refresh Power Pivot Window when i open excel file , without going the Power Pivot Window option in power pivot tab?
Vinoth,
It is possible to write VBA that triggers a 'refresh all' by placing the code in the Workbook module and using the Open_Event to trigger it as the workbook is opened.
If you are using 2010 then you will need to use this highly innovative technique developed by a guy called Tom Gleeson.
If you are using 2013 then things become more straightforward as the data model is formally exposed to VBA. There are several resources out there including this.
HTH
Jacob
There is a Refresh All button in the PowerPivot tab that you can use for this purpose. This avoids having to open the PowerPivot window just for refresh.
A caveat though: From what I remember, this just updates the tables which are linked from your current Excel workbook - for other types of connection, you have to go to PowerPivot window and refresh the respective tables.
Here is some information I found on a solution for your issue in Excel 2013:
http://www.vandeputte.org/2012/07/powerpivot-nuggets-part-18-automate.html
From Excel (not Power Pivot Manager), open:
Data
Connections
Connections
Then, select your data source and click Properties. You should see a checkbox for refreshing the data when the file is opened.
You can also right click on any Power Pivot chart or tables and click PivotTable Option... and than under data you can select Refresh data when opening the file
Excel 2013 allows for complete data model refresh through VBA. I added a button on my dashboard and assigned the following macro:
Sub Refresh()
ActiveWorkbook.Model.Refresh
End Sub
-Melissa
This is an Excel 2010 specific issue. In Excel 2013 and later the Refresh icon on the Excel ribbon does what you'd expect it to. In Excel 2010 however linked tables, the data model and pivot tables/charts aren't refreshed by the Refresh icon.
We have a solution much better and simpler than the one Tom Gleeson describes https://ukanexcel.wordpress.com/2016/11/30/refreshing-power-pivot-in-excel-2010/

Resources