ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   executing macros upon opening xls files (https://www.excelbanter.com/excel-programming/366119-executing-macros-upon-opening-xls-files.html)

dr chuck

executing macros upon opening xls files
 
I have a macro named "x" that i want to execute automatically when file
"panel.xls" is opened. Is that possible? any suggestions on how to do it?

--
dr chuck

Norman Jones

executing macros upon opening xls files
 
Hi Dr Chuck,

Try :

'=============
Private Sub Workbook_Open()
Call X
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.

---
Regards,
Norman



"dr chuck" wrote in message
...
I have a macro named "x" that i want to execute automatically when file
"panel.xls" is opened. Is that possible? any suggestions on how to do it?

--
dr chuck




Mike Fogleman

executing macros upon opening xls files
 
In a general module:

Sub Auto_open()
mymacroname 'change
End sub
or

Private Sub Workbook_Open()
mymacroname 'change
End Sub

This is workbook event code.
To input this code, right click on the Excel icon on the worksheet
(or next to the File menu if you maximize your workbooks),
select View Code from the menu, and paste the code

Mike F
"dr chuck" wrote in message
...
I have a macro named "x" that i want to execute automatically when file
"panel.xls" is opened. Is that possible? any suggestions on how to do it?

--
dr chuck




dr chuck

executing macros upon opening xls files
 
thanks for the info.
i am totally unfamiliar with workbook event code but will give it a shot.
--
dr chuck


"Norman Jones" wrote:

Hi Dr Chuck,

Try :

'=============
Private Sub Workbook_Open()
Call X
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.

---
Regards,
Norman



"dr chuck" wrote in message
...
I have a macro named "x" that i want to execute automatically when file
"panel.xls" is opened. Is that possible? any suggestions on how to do it?

--
dr chuck





dr chuck

executing macros upon opening xls files
 
thanks for your help. I am totally unfamiliar with workbook event code but i
will give it a shot.

--
dr chuck


"Mike Fogleman" wrote:

In a general module:

Sub Auto_open()
mymacroname 'change
End sub
or

Private Sub Workbook_Open()
mymacroname 'change
End Sub

This is workbook event code.
To input this code, right click on the Excel icon on the worksheet
(or next to the File menu if you maximize your workbooks),
select View Code from the menu, and paste the code

Mike F
"dr chuck" wrote in message
...
I have a macro named "x" that i want to execute automatically when file
"panel.xls" is opened. Is that possible? any suggestions on how to do it?

--
dr chuck





Norman Jones

executing macros upon opening xls files
 
Hi Dr Chuck,

i am totally unfamiliar with workbook event code but will give it a shot.


Since you are unfamiliar with event procedures, for an overview see Chip
Pearson's Events page at:

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



--
Regards,
Norman




All times are GMT +1. The time now is 04:35 AM.

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