Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default error 1004 when setting pivottable.pagefields

A code snippet:

Function FillYearMonth(ByVal theWorkbook As String, ByVal theWorkSheet
As String, _
ByVal thePivotTable As String, ByVal thePageField As String)
Dim ws As Worksheet
Set ws = Worksheets(theWorkSheet)
Dim pt As PivotTable
Set pt = ws.PivotTables(thePivotTable)
Dim pf As PivotField
Set pf = pt.PageFields(thePageField)
Dim lb As ListBox
Set lb = Worksheets(theWorkSheet).lstYearMonth
Call FillListBox(pf, lb)
End Function

I keep getting error 1004 after executing the line
Set pf = pt.PageFields(thePageField)


Can anyone point me what is wrong in this code?


--
Amedee
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
error 1004 (VBA) Harlan Grove Setting up and Configuration of Excel 0 May 15th 06 07:33 PM
error 1004 (VBA) vsiat Excel Discussion (Misc queries) 1 May 15th 06 07:17 PM
Run time error 1004, General ODBC error [email protected] New Users to Excel 0 September 19th 05 01:41 AM
Runtime error '1004' General ODBC error star_lucas New Users to Excel 0 August 29th 05 04:09 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM


All times are GMT +1. The time now is 12:03 PM.

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"