View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dick Kusleika[_4_] Dick Kusleika[_4_] is offline
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