ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Chart_Activate not running when workbook opened (https://www.excelbanter.com/excel-programming/371927-chart_activate-not-running-when-workbook-opened.html)

[email protected]

Chart_Activate not running when workbook opened
 
Hi. I have this code entered for one of my charts:

Private Sub Chart_Activate()

'update pivot table when chart becomes active
UpdatePivotTables

Module1.UpdateDataLabels

End Sub

This works fine. It executes everytime I click the chart's tab.

The problem I'm having is that if this chart is current when I first
open the workbook, the code does not run until I leave the chart then
click back to it.

How can I get the chart updated if it is current when I open the
workbook?

Thanks!

Ken


moon[_6_]

Chart_Activate not running when workbook opened
 

Private Sub Workbook_Open()
ThisWorkbook.Sheets("chartstab").Activate
End Sub



schreef in bericht
oups.com...
Hi. I have this code entered for one of my charts:

Private Sub Chart_Activate()

'update pivot table when chart becomes active
UpdatePivotTables

Module1.UpdateDataLabels

End Sub

This works fine. It executes everytime I click the chart's tab.

The problem I'm having is that if this chart is current when I first
open the workbook, the code does not run until I leave the chart then
click back to it.

How can I get the chart updated if it is current when I open the
workbook?

Thanks!

Ken




Jon Peltier

Chart_Activate not running when workbook opened
 
Private Sub Workbook_Open()
ThisWorkbook.Worksheets(1).Activate
ThisWorkbook.Sheets("chartstab").Activate
End Sub

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"moon" <6369706865725F6475646540706C616E65742E6E6C wrote in message
. ..

Private Sub Workbook_Open()
ThisWorkbook.Sheets("chartstab").Activate
End Sub



schreef in bericht
oups.com...
Hi. I have this code entered for one of my charts:

Private Sub Chart_Activate()

'update pivot table when chart becomes active
UpdatePivotTables

Module1.UpdateDataLabels

End Sub

This works fine. It executes everytime I click the chart's tab.

The problem I'm having is that if this chart is current when I first
open the workbook, the code does not run until I leave the chart then
click back to it.

How can I get the chart updated if it is current when I open the
workbook?

Thanks!

Ken







All times are GMT +1. The time now is 11:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com