Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Derived Columns in Pivot Table | Excel Discussion (Misc queries) | |||
Need to Improve Code Copying/Pasting Between Workbooks | Excel Discussion (Misc queries) | |||
pivot table created from another pivot table | Excel Worksheet Functions | |||
Change Data In Pivot Table | New Users to Excel | |||
Pivot Table Problems | Excel Discussion (Misc queries) |