Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

VBA error with Pivot Cache

  Asked By: Darla    Date: Aug 25    Category: MS Office    Views: 1031
  

I have an Excel file which extracting data from a database with a
webapplication. After creating the report I open the file, and run a macro,
which creates a Pivot table. Now I get an error message "Cannot create Pivot
table source file <& filename>". Strangely, I don't get this error message when
I save the file first Checking into the problem, I found that once I open the
file from IE6.0 the Excel header shows the file name with the appendix [1]
(example: Prww2a-EXCELacf21669baaa40d[1].xls ), while ActiveWorkbook.Name shows
this file's name with the appendix (1). The difference is appendix [1] vs. (1).

When developing the macro, I used Netscape 7.1 and did not have this error;
thus it might be it's only occurring in IE6.0

The error occurs in this line when creating the PivotCache:
Sheets(MWS).Activate
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
MWS & "!R1C1:R" & LRow & "C" & LCol).CreatePivotTable
TableDestination:="", _
TableName:="NSID_Pivot"

The parameters are: MWS = main Worksheet name, LRow = last row of data, LCol =
last column of data.

Any idea why I get this error? Any way to suppress the appendix [1] when opening
in Excel? Unfortunately saving the file first is not an option.

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on VBA error with Pivot Cache Or get search suggestion and latest updates.




Tagged: