View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Print Excel Workbook When Open

open the workbook, go to the VBE (Alt+F11), in the project explorer, click
on the project, then right click on the ThisWorkbook entry for that
workbook. Select view code. In the resulting code module, in the left
dropdown at the top, select workbook, and at the right dropdown select open.
At any point, the sub

Private Sub Workbook_Open()

End Sub

will appear in the module. When it does, call your macro from there

Private Sub Workbook_Open()

MyMacro

End Sub

That fires whenever a workbook is opened as long as events are enables.

Read about events at Chip Peasons site

http://www.cpearson.com/excel/event.htm



--
Regards,
Tom Ogilvy
"Paul Scott" wrote in message
...
Is there a way to program an Excel file to run a macro
when the file opens?