Automatically fire come code when workbook is opened
Posted on 2011-09-06
I have an access application that exports some data out to an excel template (.xlt) and subsequently opens the template in excel.
I have a command button at the top of the excel worksheet that fires some code DoTasks() when it is clicked.
The DoTasks() procedure resizes some columns and drops a subtotal line at the end of the data.
The user pretty much always clicks the command button, so I would like to just automatically run the DoTasks() when the workbook opens and remove the command button altogether.
How can I make the DoTasks() automatically fire? Thanks!