PowerPivot Window won't show: - Index out of range - powerpivot

PowerPivot for Excel workbook with 14 tables. The powerpivot window opens but does not display any data. The error received is
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Any thoughts?

I found one possible solution. In this case the diagram view was still available, and I had one calculated column which was in error. I deleted this column from the diagram view and the table view was visible once more.
Interestingly, the same table had measures which were in error, but these did not cause issues.

Related

Excel XMP mappings to a table - expand rows automatically

I have an excel table, and the rows are linked to XML source node. The XML data is refreshed by a query, which returns 0..N rows.
In excel, the table automatically shows the rows - which is good. When it returns 0 or 1 rows - the table shrinks. Nice. When it returns 10 rows, the table expands, shifts the page contents down below the table. When the query returns 1 rows (again), the table shrinks (again), but the shifted content remains shifted - a lot of empty rows remains below the table.
When the query return 12 rows (again), the same happens - table expands, content below the table shifts down again. And again. And again.
I wonder if I can do something against it. The best solution would that creating a fix range for the table to epxand and shrink inside that range - without shifting down the page content.
I read a lot about excel tables - but cannot find any options and settings about it. Could anybody help about it? Or is it impossible? Using VBA is possible.

Excel SQL Table Formula's clearing

Apologies if asked elsewhere, having checked couldn't find anything. I've got a SQL driven table in Excel. When my table refreshes, resulting in no data, it completely clears out a series of none-SQL driven columns on the far right of the table. Is there any way at all I can force Excel to store the formula on the cell, regardless of whether the row has cleared?
To ellaborate on my comment:
Below shows a simple query returning 10 dates from a database. The right column is a simple formula in excel adding 10 to the date:
If I update the query to return the top 0, you find the formula disappears because there are no values to assign the formula to:
But, I then update the query to bring back the original 10 dates again, and hey-presto, the formula re-appears!:
So I wouldn't think that you need to worry that it has gone. I would expect that they would come back once you return some values from your query.
FYI - More help on calculated columns can be found here from Microsoft support.
Thanks! I think I had 'preserve column sort/filter/layout' unticked - which was causing the formula to be lost when the data refreshed! Schoolboy error, thanks again

Excel 2010 Macro Pivot Label Filter

I am having an issue running a label filter on a column (classic view) within my pivot table. I am trying to weed out the items in the data that are less than 180 days old. I can't adjust the data because it is used to feed multiple worksheets and I don't wish to copy the data and manipulate it for just this worksheet. Below is the line that I am running.
ActiveSheet.PivotTables("PivotTable5").PivotFields("Ageing").PivotFilters.Add _
Type:=xlCaptionIsBetween, Value1:="180", Value2:="9999"
This is a "between" filter. I have tried greater than and greater than or equal to but the same result occurs. After this line is run, I can click into the pivot table soft/filter down arrow and see that the filter is there as a between and even the days are inputted but the data does not reflect this. If I hit "OK" on the filter it then applies itself but I do not wish to have to do this manually.
Yes, "PivotTable5" is the pivot table in question. Can anyone help me automate this process?

Use columns.add(...) in Word with non-uniform column widths?

Problem I'm having is that table.Columns.add(ref Object BeforeColumn) requires a reference to another column in the table. However, when I try to access the last column in the table to pass as a reference using table.Columns.Add(table.Columns[table.Columns.Count])
I get the error:
"Cannot access individual columns in this collection because the table has mixed cell widths."
As my current work around, I catch the error, and call table.Columns.DistributeWidth() to make sure the columns are uniform and run the rest of the code. However, I lose the formatting of my cell widths this way, which is unfortunate.
Is there any way I can workaround this without losing the cell width?
(I realize one way is to store every cell's width before running this process, and then re-applying the widths afterward, but this seems like a very costly solution to something that should be simpler)
I've found one way to do it. Here's how I approached it.
*Caution, I'm assuming that the table is uniform. i.e. The number of columns is the same across all the rows. (Note, the API has a Table.uniform function, but the description is not complete. In the API it says "True if all the rows in a table have the same number of columns." However, it also checks if the columns have uniform width).
Instead of using table.Columns.Add(table.Columns[table.Columns.Count]) to add a column before the last below, I select a cell in the table and used the insert command:
//assuming table is the name of the table you want to add columns to
table.Cell(1, table.Columns.Count).Select();
word.Selection selection = table.Application.ActiveWindow.Selection;
selection.InsertColumns();
This might actually be a better way to add columns, as the api gives you way more options on how to insert (i.e. use InsertColumnsRight to insert to the right of the column). The Columns.Add(...) function by default inserts to the left of the select

A Pivot Table report cannot overlap another Pivot Table report

Hi I have 3 pivot tables in same sheet and data source is danamically changing when refresh depend on the parameter value which is passing from the front end. It is a report and I have done the layout. But sometimes when the row count is more, Im getting above error message which is "A Pivot Table report cannot overlap another Pivot Table report" .
Do we have any setting to do setup to auto add cells depend on no of rows ? like in tables/data range ?
How can we resolve this issue dynamically ?
Thanks everyone in adavance.
If they are prone to change size there seems little to be gained from having them all in the same worksheet, so hold each in a separate worksheet. Otherwise you should be able to avoid the processing stalling due to overlap by spacing the PTs apart by more than enough blank rows/columns to allow room for as much expansion as would ever be required. If that means the PTs appear too far apart from one another for convenience hide the extra rows/columns until part of one or more PT spills into the hidden area and then unhide as required.