Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default VBA Not Running in Exported Pivot Table

Using MS Access I've created a Piviot Table imbedded into an Access Form. I'm
opening a Pivot Table for editing in Excel my following code won't run:

Sub mcrRefreshPvt()
'
' mcrRefreshPvt Macro
' Keyboard Shortcut: Ctrl+r
'
ActiveSheet.PivotTables("PivotTable1").PivotCache. Refresh
End Sub

However, if I follow the Debug prompt & then clik on "ThisWorkbook" I am
able to run my code & refresh the Pivot table. How do I get this code to
automatically run when I open the table in excel?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default VBA Not Running in Exported Pivot Table

On Thu, 8 Mar 2007 14:22:43 -0800, David127
wrote:

Using MS Access I've created a Piviot Table imbedded into an Access Form. I'm
opening a Pivot Table for editing in Excel my following code won't run:

Sub mcrRefreshPvt()
'
' mcrRefreshPvt Macro
' Keyboard Shortcut: Ctrl+r
'
ActiveSheet.PivotTables("PivotTable1").PivotCache. Refresh
End Sub

However, if I follow the Debug prompt & then clik on "ThisWorkbook" I am
able to run my code & refresh the Pivot table. How do I get this code to
automatically run when I open the table in excel?


What error do you get? It almost sounds like what you consider to be
the ActiveSheet and what Excel does are different. That doesn't
really make sense, but that's what it sounds like. Where is the code?
Is it in the workbook with the pivot table?
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default VBA Not Running in Exported Pivot Table

The code is in the workbook with the Pivot Table. The Pivot Table is embedded
in my MS Access Form as an "OLE".

However, I crated it again using the Record Macro function & got the
following that works:

Sub mcrRefreshPivot2()
'
' mcrRefreshPivot2 Macro
'
ActiveSheet.PivotTables("PivotTable1").RefreshTabl e
End Sub

In this case "Pivotcache" is omitted. I don't pretend to understand this but
if you could tell me how to make it run upon opening the pivot table I'd be
very greatfull.

David



"Dick Kusleika" wrote:

On Thu, 8 Mar 2007 14:22:43 -0800, David127
wrote:

Using MS Access I've created a Piviot Table imbedded into an Access Form. I'm
opening a Pivot Table for editing in Excel my following code won't run:

Sub mcrRefreshPvt()
'
' mcrRefreshPvt Macro
' Keyboard Shortcut: Ctrl+r
'
ActiveSheet.PivotTables("PivotTable1").PivotCache. Refresh
End Sub

However, if I follow the Debug prompt & then clik on "ThisWorkbook" I am
able to run my code & refresh the Pivot table. How do I get this code to
automatically run when I open the table in excel?


What error do you get? It almost sounds like what you consider to be
the ActiveSheet and what Excel does are different. That doesn't
really make sense, but that's what it sounds like. Where is the code?
Is it in the workbook with the pivot table?
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com

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
Pivot Table Running Sum % Charlie Bamford Excel Discussion (Misc queries) 10 September 19th 12 08:53 PM
Pivot Table-Running Total rushdhih Excel Worksheet Functions 0 February 4th 10 08:14 AM
Pivot table running % total Valeria Excel Discussion (Misc queries) 1 October 10th 08 08:06 PM
How do I do running Totals in a Pivot Table Pivot Freak Excel Worksheet Functions 2 February 7th 06 05:30 PM
Pivot table and running total PaulGG Excel Discussion (Misc queries) 0 November 28th 05 09:39 PM


All times are GMT +1. The time now is 10:33 AM.

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"