View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
andycharger[_23_] andycharger[_23_] is offline
external usenet poster
 
Posts: 1
Default Trouble recreating Pivot table changes in VBA

Im having some problems with my pivot table changes in VBA

I am calling my pivot table up like below but when I add the sourcetyp
and sourcedata, it gives me the following error:

Run Time Error '1004';
The Pivot table field name is not valid. To create a pivot tabl
report, you must use data that is organised as a list with labelle
columns. If you are changing the name of a pivot table field , you mus
type a new name for the field

Here is my code:
[vb]
Sheets("source Code").Activate
ActiveSheet.PivotTableWizard SourceType:=xlDataBase
SourceData:="'!Quotes 2004' !$a$1:$k$6336"
ActiveWorkBook.ShowPivotTableFieldList = True
[/vb]

Anyone shed any light on this

--
Message posted from http://www.ExcelForum.com