View Full Version : Auto Run macro on Excel object Embedded in Access


pliskers
11-02-2006, 03:08 PM
I have an embedded pivot table module that launches Excel via a start form in Access. I'd like an autorun macro to run each time the Excel module is opened. I've tried everything - Auto_Open macro in Excel, Private Sub WorkBook_Open() in Excel, but I can't get the thing to run.

Any ideas? Here's the code I've used:

Private Sub WorkBook_Open()
Application.ScreenUpdating = False
For Each Sht In ThisWorkbook.Worksheets
Sht.Activate
Sht.Range("A1").Activate
Next Sht
Sheets("T of C").Select
End Sub