Thread: Autorun
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default Autorun

2 ways. One is with and event. See Chip Pearsons site for more info.
http://www.cpearson.com/excel/events.htm

The very simple way is to name the procedure as this:-

Sub Auto_Open() and it will run automatically evary time you open the
workbook.

Sub Auto_Close() runs on closing the workbook.

Regards,

OssieMac

"EmilH" wrote:

Hi.

How can I make my code run as soon as the .xls document is opened?

Thanks in advance.
EmilH.