ActiveSheet.PivotTableWizard _
SourceType:=xlExternal, _
SourceData:=Array(strSQL, strSQL1), _
tableDestination:=Worksheets(strSheet).Range(quot;a2quot;) , _
tableName:=strSheet, _
RowGrand:=True, _
ColumnGrand:=True, _
SaveData:=True, _
HasAutoFormat:=True, _
BackgroundQuery:=False, _
Connection:=Array(g_strConn)
its giving me an error
quot;Run-time error 1004 -- Pivot table wizard method of worksheet class
failed.quot;
it also calls verifyPivot name as strPivot =
VerifyPivotName(strSheet).
strsheet is coming up with value quot;sheet1quot;.
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(quot;a2quot;).Select
If nCount gt; 0 Then
strPivot = Worksheets(strSheetName).PivotTables(1).Name
Else
VerifyPivotName = quot;-99990000quot;
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: www.excelforum.com/member.php...oamp;userid=31510
View this thread: www.excelforum.com/showthread...hreadid=511867
- May 27 Tue 2008 20:44
pivot table error.Please help! very urgent
close
全站熱搜
留言列表
發表留言