LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro statement will not run a second time without closing and reopening

I recorded a macro that created two pivot tables from an external DB. The
first time it runs in "Book1" ok. The second time the statement below
causes a run time error. I have to close and re-open excel to make it run
all the way through on another database. What can I do to make it run in
"Book2" etc. without having to close and re-open excel.

'******* Run time error 1004 unable to get the Pivot Tables property of the
worksheet class

ActiveSheet.PivotTables("PivotTable2").AddFields RowFields:="dosmoyr", _
ColumnFields:="transmoyr", PageFields:="facilityid"

Pete Straman

--
Message posted via http://www.officekb.com
 
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
Closing and reopening the same file Tom Excel Discussion (Misc queries) 16 March 11th 09 09:31 PM
real estate closing statement debfurla Excel Discussion (Misc queries) 0 May 9th 07 04:01 PM
Can I stop Excel from reopening personal.xl when I run a macro? D Wright Excel Discussion (Misc queries) 2 August 23rd 06 06:17 PM
closing 1 file at a time Keith G Hicks Excel Discussion (Misc queries) 4 September 4th 05 02:16 AM
My comments reformat after closing and reopening. Picman Excel Discussion (Misc queries) 0 May 25th 05 04:34 PM


All times are GMT +1. The time now is 02:12 AM.

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

About Us

"It's about Microsoft Excel"