View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Open Workbook with Macros

Hi Dave,

Try something like:

'=============
Private Sub Workbook_Open()
'Your code, e.g.:
MsgBox "Hi"
End Sub
'<<=============

This is workbook event code and should be pasted into the workbook's
ThisWorkbook module *not* a standard module or a sheet module:

Right-click the Excel icon on the worksheet
(or the icon to the left of the File menu if your workbook is maximised)
Select 'View Code' from the menu and paste the code.
Alt-F11 to return to Excel.

For an overview of Event procedures see Chip Pearson's Events page at:
http://www.cpearson.com/excel/events.htm


---
Regards,
Norman



"Dave" wrote in message
...
I need to create a macro that when ran will open one specific workbook.
The
workbook's name will not change and will be located in the same place on a
server, which will not change. Can aynone help me? Thanks.