Source Data In Pivot Cache Returning Error
Jan 25, 2013
What is causing this to error. Basically I'm just trying to highlight cells, and create a pivot table out of that. Here's my Code:
Sub Macro1()
'
' Macro1 Macro
Dim myRange As String
myRange = "Sheet1" & Selection.Address
Sheets.Add
[Code] ..........
When I debug, the value of myRange is something like Sheet1$A$19:$K$37 with the actual cell values being whatever I highlighted. I get a Runtime Error 5 Invalid procedure call or argument. I'm assuming it's something with my sourcedata variable, but I'm not sure what.
Also, I did try commenting out the Sheet.Add and Sheets("Sheet2").Select Cells(3, 1).Select lines, but it still produced the same results.
View 9 Replies
ADVERTISEMENT
Jul 15, 2013
I am trying to fix a report for a remote coworker in excel, they tell me they get
Run-time error '5': Invalid procedure call or argument
When they run the Macro, here is where it stops executing
Code:
Range("C6").Select
ActiveSheet.PivotTables("PivotTable2").ChangePivotCache ActiveWorkbook. _
PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Data!$A:$Y" _
, Version:=xlPivotTableVersion14)
Now, the problem is that I am unable to recreate the error, and it always works fine for me. I am the 'excel guy' around the office, but I'm still learning VBA, so I am not entierly sure what is going on in this section of code, but I generally follow it.
View 5 Replies
View Related
Jun 22, 2009
Let's say I have a pivot table made from data in another workbook. The other workbook is then deleted. Is there anyway to get the original data back? My particular file is about 10 MB, but if I "save as" it's only 1 MB. Plus, the pivot table "works," so I'm pretty sure Excel still has my data cached somewhere. How can I access it? I'm decent with VBA, so I'm open to any solution at all.
View 5 Replies
View Related
Dec 20, 2013
We are trying to create pivot cache from an external .csv file.
This works fine when the csv file is small (~500 mb).
Attaching sample code for reference -
Code:
Dim cConnection As ADODB.Connection
Dim rsRecordset As ADODB.Recordset
Dim pvtCache As PivotCache
Dim pvtTable As PivotTable
Dim SQL As String
''Creating ADODB connection object
[Code] ...........
View 5 Replies
View Related
Jul 7, 2014
I have a pivot table that I created and now I want to use the same pivot cache to create another pivot table instance on a different worksheet. how can I do that? My first worksheet gets saved as "OO By buyer" and now I want to create a new worksheet and drop the next pivot there.
View 1 Replies
View Related
Sep 7, 2006
I have a report that was created for 2005 that contains two worksheets: a "source data" worksheet and a " pivot table" worksheet. I cleared out the 2005 data in the "source data" worksheet and replaced it with 2006 data...after this I refreshed the Pivot Table and everything seemed fine. When looking at the file size I noticed that it was almost twice its original size....upon further investigation I found that the Pivot Table was internally holding onto the old source data (the "Show" functionality of the rows/columns in the table lists the 2005 row/column headers as well as the 2006 headers....even though no data from 2005 is shown in the Pivot Table).
Does anyone know how to purge the old data from the internal Pivot Table memory?
I hope this is enough information....let me know if you need more.
Thanks in advance for any help,
Jon
View 9 Replies
View Related
Mar 13, 2014
My macro is designed to look at a summary source tab and create a new tab for each unique project number. It then creates a pivot table from five different source detail tabs and filters on the project number. If a tab already exists it selects the tab and moves on to the next project number. There are six pivot tables created for every project.
New data is added each month to the source tabs and I have a macro to delete all pivot tables and the macro will recreate the pivot tables when ran again.
Issue: Running out of resources At work I'm limited to the use of Excel 2010 (32bit) so I'm restricted on 2GB of memory. At home I ran the file successfully (64bit) and it was around 3GB of memory.
My macro creates a new pivot cache for every pivot table where as I'm trying to only use 6 pivot caches in my coding. I kill it half way through and it's around 100+ caches causing unnecessary usage of memory.
Fix / Solution:
Correctly code the vba to only create six caches and code the rest the pivot tables to use that cache.The only difference in the Pivot Tables is that it’s sorted on the Project Number.
Code:
Dim VBAPPPC As PivotCache
Dim VBAAPPC As PivotCache
Dim VBAPRPC As PivotCache
Dim VBAEXPC As PivotCache
Dim VBAMJPC As PivotCache
Dim VBAIVPC As PivotCache
Dim VBAPT As PivotTable
[code]...
View 1 Replies
View Related
Nov 14, 2012
I am trying to adapt a macro to run on data that is consistently in the same format but the data does change, the macro needs to run over and over on new excel workbooks, dynamic range ? instead of a set source ?
Sheets.Add
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"weekly71012!R1C1:R9379C30", Version:=xlPivotTableVersion14). _
CreatePivotTable TableDestination:="Sheet1!R3C1", TableName:="PivotTable1" _
, DefaultVersion:=xlPivotTableVersion14
I am sure this is the problem as i initially created the macro using weekly71012 excel file however i just want it to run on every file i pull it off?
View 2 Replies
View Related
Jan 21, 2013
I have a single workbook with multiple worksheets. Each worksheet has a different pivot table displaying a different view of the data. Each pivot table uses the same source data at worksheet1.
Each week i add new data to the end of the source data, which means that I need change the source data reference separately in each pivot table to update each pivot table view to include the new data. This is laborious as there are quite a few pivot tables.
Was wondering if there is some way of changing the pivot table source data reference on all pivot tables at the same time.
View 4 Replies
View Related
Aug 20, 2008
I am trying to create multiple pivot tables from the same pivotcache using VBA. The data range is approximately 270,000 records with 100 columns. When I run the macro, I get "Run-time error '-2147352567 (80020009)' Method 'Add' of object 'PivotCaches' failed". Is there a size limit on the data? If there is less than 65,000 records, it works great; if I use a wizard, it works with no problems with the full dataset. If I bring the data in as an Access table, it can work with some tweaking of the code, but the size of the file is huge because each pivot is taking its own snapshot of the data. I also can only create 3 tables before it runs out of memory, so I have to stop, save the file, and open it back up to create 3 more pivots.
Dim WSD As Worksheet
Dim PTCache As PivotCache
Dim PT As PivotTable
Dim PRange As Range
Dim FinalRow As Long
[Code] .........
The last line is where I am getting the error. I am running XP, Excel 2007.
As I said, if I import an Access table, I can use the code:
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Table_Pivot_test.accdb[#All]", Version:=xlPivotTableVersion12). _
CreatePivotTable TableDestination:="", TableName:=txtPivotTableName, DefaultVersion:=xlPivotTableVersion12
And loop, but the final file size with 14 pivots can be 500MB! I have tried both "Create" and "Add", but they both give me errors.
View 8 Replies
View Related
Jun 4, 2008
I am currently taking over a workbook from a colleague that contains 10 pivot tables. Spaced out over a few sheets.
Each pivot table contains a lot of information and my current workaround to refreshing them all is..
Step1:Refresh 2 Pivots,
Step2:Save and Close document,
Step3: Re-Open document and repeat Steps 1 & 2 until all refreshed.
I was wondering if there was any kind of code to clear the memory space being used by the pivots thus leaving the hard coded information behind.
That way I can just write some vb to refresh all the pivots and not keep saving and re-opening the document which takes sometime as its on a network drive.
View 9 Replies
View Related
Nov 7, 2011
option 1
sourcedatastring = '\myunc\_WT_.xls'!$A$1:$CI$65536
option 2
sourcedatastring = 'L:\_WT_.xls'!$A$1:$CI$65536
using VBA i do this:-
pvtTable.SourceData = sourcedatastring
only option 2 works.. when i put a UNC drive as a sourcedata the pivot does not like it.. why? is there anyway i can solve that?
I need to put a UNC location as source data in pivottable in VBA but how?
View 1 Replies
View Related
Aug 24, 2009
I was wondering if anyone knows how to change the souce data for a Pivot Table?
Eg if I have the Pivot table looking at Columns A & B lines 1 - 20 and I want the Pivot to also include Column C and lines 21 - 50, how would I do this? for a chart I can just right click and select the "Source Data" option but it seems that this is not available for Pivot Tables.
View 3 Replies
View Related
Apr 10, 2013
A co-worker of mine set up a pivot table using data saved on an external data source on a shared drive. I would like to create a similar pivot table myself, linked to his pivot table so when he gets updated data, my pivot table also will update accordingly. My question has to do with the pivot table data source. How do I copy the connection?
View 3 Replies
View Related
Mar 27, 2009
I have a pivot table created. How do I determine which sheet it is pulling the data from, hence the source of the pivot table? Also, if can you go into source and modify data points, then in pivot table, will the results would be automatically modified with updated data points?
View 2 Replies
View Related
May 10, 2009
I've got a bit of a problem revealing pivot table source data, so just wondering if anyone know how to reveal it? My colleague sent me the spreadsheet, I can see the pivot table, but I can't find the source data that the pivot table links to.
View 3 Replies
View Related
Sep 9, 2009
In cell A1 I have a forumlar which equals 'A2:F1465' which is the range of my data, how can I get a pivot table to use this for it's values as when I do it normally it asks me to manually select the range as above?
View 2 Replies
View Related
Sep 26, 2011
I am using pivot tables/charts for drilldown reporting. After running a complex macro to consolidate multiple reports into one range, I need to generate pivot tables and charts.
These reports will change month to month in the number of entries they have (template will be identical), and therefore my data source range for the pivot table is bound to change. Therefore my question is, how to develop a macro that will dynamically change the source data range to the amount of rows?
View 5 Replies
View Related
Mar 8, 2013
I have a Pivot table which is created by running a macro with formula calculated columns.
Q1. when i add another column in data sheet, and change the source manually, i get a error in calculated columns
Q2. I need to add the new column in data sheet to the row labels of the existing pivot sheet. with change formula calculated columns.
Q3. can we have any macro to this ?
View 3 Replies
View Related
Jan 11, 2010
I have a number of pivots in a workbook. Well, I created a macro that updates the data sheets (located in the same workbook) and every time I run the macro, my data source for pivots changes and doesn't pull in all the columns. I'm at a loss as to why that happens (Although, I think it has something to do with macro deleting some columns and adding new ones).
View 9 Replies
View Related
Feb 22, 2010
why the data reference for a pivot table is changing after I email the workbook to a client. The source data and the pivot tables are all part of the same workbook and I can't understand why its saying can't find source data. Excel 2007 is being used on both computers.
View 9 Replies
View Related
Apr 24, 2006
I am using pivot tables which were created by another (no longer contactable) and have found two fields in the field list which are not part of the source data i.e. neither are column headings but are used in the pivot table.
My questions are:
1. How are these field created?
2. How can I examine these fields for formulae (as I have found one of them returns an incorrect value)?
Field1 return a numerical value which is the difference between two columns
Field2 shows this as a % (but incorrectly)
View 4 Replies
View Related
May 31, 2007
My fixed asset software will not allow me to show multiple individual months of acquisitions. I can export each month. This will create a separate spreadsheet for each month, but the problem is that each spreadsheet may contain the same asset, but additions to that asset.
Spreadsheet 1
....Description............................Dept...................January acquisition
.....Building____________________Plant______________1,000,000
Spreadsheet 2
.....Description..........................Dept...................February acquisition
......Building___________________Plant______________1,000,000
.....Welder____________________Metal_________________5,000
What I want is this
Spreadsheet 3
.....Description.........................Dept..................January Acq..........February Acq
......Building__________________Plant____________1,000,000__________1,000,000
......Welder___________________Metal_________________________________5,000
View 4 Replies
View Related
Nov 27, 2007
Will someone please tell me the difference (if there is a difference) between the following 2 lines of ....
View 6 Replies
View Related
Nov 20, 2010
I have some source data which is used to generate a pivot table. The data is conditionally formatted to color certain cells based on some other values. Once the data is transferred to the pivot table this formatting (as well as the number formatting) is lost.
I have found some code to fix the number formatting issue but can't seem to locate something similar to set the interior color of the cells in the pivot table to match that of the original source data.
View 2 Replies
View Related
Aug 8, 2013
I have a pivot table whose data source is located on a shared network drive. Each day a new data source is uploaded and the only thing that changes is the date in the filename (ie. DataSource080813.xlsx). I am trying to find a way to set the data source to update with todays date automatically each day so that when you open the workbook it is always current days data. I have a cell (B2) with a formula in it that gives me the file location of todays file (ie. X:TeamFolderFile1DataSource080813.xlsx, where the date is derived using the TODAY() function. Is there a way to set the pivot table data source to cell B2 and have it use the text from B2 as the file location?
View 1 Replies
View Related
Apr 30, 2014
I am using an Excel file (Raw.xlsx) to store my raw data, and take another Excel file (Pivot.xlsx) to make PivotTable from Raw.xlsx
When generating the PivotTable, every works fine. When click [Refresh] in the Raw.xlsx, whatever changes been made in the Raw.xlsx can "sync" to the Pivot.xlsx
However, once I save and reopen the Pivot.xlsx, I can't refresh the PivotTable anymore. I've tried changing Data Source, but it doesn't work.
View 1 Replies
View Related
Dec 31, 2013
Trying to create a basic pivot table from a CSV file for our users. What I've done in the past is open my CSV and then take the option Insert > Pivot Table to create the pivot table from the open CSV/worksheet. My question here is .... how can I save this .XLS and refresh the CSV data within? Or do I need to use an external data source? I don't want to have to use any drivers. I'd love to be able to just point to a CSV or TXT file on our server and that be that.
For something else I have used Web Query strings to point to .php scripts that send back data in XML format. Is this an option?
Again, the goal is for me to create a pivot table and just have our user's open it up and have current/refreshed data within. We can run jobs overnight or on-demand that update the data source.
View 1 Replies
View Related
Jan 7, 2009
I would like not to have to update the source data for the pivot table in my database. I've read that you can solve this by using a Dynamic Named Range and using that as the source for the pivot table. That way the pivot table will expand as new data is added to the database. The formula I used to create the DNR is:
View 7 Replies
View Related
Jul 17, 2009
I wish to hide some columns that contain data used to update a pivot table in another worksheet. What I want to know is though, will this affect the pivot table? I think that graphs in excel will normally ignore data in hidden cells, so I was wondering if it was the same with pivot tables.
View 2 Replies
View Related