Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 31
Default Problem with creating pivottable

Hello,

I have a problem with making a pivottable from my data with visual basic.
When running the code visual basic says that there is an invalid procedure
call or an invalid argument. The part of the code that is wrong according to
visual basic is the uppermost part(from ActiveWorkbook till
xlPivotTableVersion10). I use the next code for making the pivottable:

Sub creatingpivottable
'Start wrong part of code
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _
"'Bewerkte data'!R1C1:R10000C18").CreatePivotTable
TableDestination:= _
"Blad1!R3C1", TableName:="Draaitabel8", DefaultVersion:= _
xlPivotTableVersion10
'End wrong part of code
Worksheets("Blad1").Activate
With ActiveSheet.PivotTables("Draaitabel8").PivotFields ("Proj.")
.Orientation = xlColumnField
.Position = 1
End With
With ActiveSheet.PivotTables("Draaitabel8").PivotFields ("verschil")
.Orientation = xlRowField
.Position = 1
End With
ActiveSheet.PivotTables("Draaitabel8").AddDataFiel d
ActiveSheet.PivotTables( _
"Draaitabel8").PivotFields("Niveau "), "Aantal van Niveau ", xlCount
ActiveSheet.PivotTables("Draaitabel8").ColumnGrand = False
End Sub

'Bewerkte data' is the name of the sheet with the data that is used for
making the pivottable and 'blad 1' is the name of the sheet where the
pivottable has to be placed (this sheet exists before I start the code).
'Draaitabel8' is the name of the pivottable. I start the code with a button
on the sheet 'Bewerkte data'.
Visual basic makes the pivottable well when I click on 'continue'(the 'play'
button) in visual basic after that visual basic says that there something
wrong when running the code. So after visual basic says that there is a
mistake in the code, it makes the part of the code that is wrong yellow. When
I then click on 'continue' the pivottable is made well.
I hope the problem is clear, if it is not let me know. It would be great if
someone could help me! Thanks in advance!

Ruben
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a PivotTable w/o selecting data in an existing PivotTable Damian Excel Discussion (Misc queries) 6 November 2nd 07 04:44 PM
Error message when creating PivotTable Alexandre Excel Discussion (Misc queries) 1 November 27th 06 10:06 AM
PivotTable grouping problem septillion Excel Discussion (Misc queries) 0 July 4th 06 01:58 AM
Creating Multiple Charts from One PivotTable mkehoe Charts and Charting in Excel 0 March 17th 06 11:57 PM
Pivottable Problem mmwheeler Charts and Charting in Excel 1 August 4th 05 04:08 AM


All times are GMT +1. The time now is 09:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"