View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
anu_manu
 
Posts: n/a
Default pivot table error.Please help! very urgent


ActiveSheet.PivotTableWizard _
SourceType:=xlExternal, _
SourceData:=Array(strSQL, strSQL1), _
tableDestination:=Worksheets(strSheet).Range("a2") , _
tableName:=strSheet, _
RowGrand:=True, _
ColumnGrand:=True, _
SaveData:=True, _
HasAutoFormat:=True, _
BackgroundQuery:=False, _
Connection:=Array(g_strConn)

its giving me an error
"Run-time error 1004 -- Pivot table wizard method of worksheet class
failed."

it also calls verifyPivot name as strPivot =
VerifyPivotName(strSheet).
strsheet is coming up with value "sheet1".

but the function verifypivotname doesnt show it.
Public Function VerifyPivotName(strSheetName As String) As String
Dim nCount As Integer
Dim strPivot As String

nCount = ActiveSheet.PivotTables.Count
ActiveSheet.Range("a2").Select

If nCount 0 Then
strPivot = Worksheets(strSheetName).PivotTables(1).Name
Else
VerifyPivotName = "-99990000"
Err.Raise 2
Exit Function
End If

cud this be a possibility tht i hav to name the pivot table first. if
yes how?
please help .


--
anu_manu
------------------------------------------------------------------------
anu_manu's Profile: http://www.excelforum.com/member.php...o&userid=31510
View this thread: http://www.excelforum.com/showthread...hreadid=511867