ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open Workbook with Macros (https://www.excelbanter.com/excel-programming/380393-re-open-workbook-macros.html)

Norman Jones

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.





All times are GMT +1. The time now is 01:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com