ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet (https://www.excelbanter.com/excel-programming/299410-excel-macro-issue-trying-autorun-macro-upon-opening-worksheet.html)

wyndman

Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet
 
I'm trying to have Excel run a macro I have written when a spreadshee
is opend. I have a windows script that will open Excel for me, and th
spreadsheet I need, but so far I've had little luck getting the macr
to run. I've coded it into the actual sheet to run when it starts, bu
it can never find the macro. :confused

--
Message posted from http://www.ExcelForum.com


Tushar Mehta

Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet
 
Put the code in the Workbook_Open routine of the Workbook module.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article , wyndman
says...
I'm trying to have Excel run a macro I have written when a spreadsheet
is opend. I have a windows script that will open Excel for me, and the
spreadsheet I need, but so far I've had little luck getting the macro
to run. I've coded it into the actual sheet to run when it starts, but
it can never find the macro. :confused:


---
Message posted from http://www.ExcelForum.com/



Gord Dibben

Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet
 
Auto run code does not go into the Worksheet module.

Two methods...

1. In a general module

Sub Auto_Open()
'your code here
End Sub

2. In the ThisWorkbook module

Sub Workbook_Open()
'your code here
End Sub

Gord Dibben Excel MVP


On Tue, 25 May 2004 08:27:48 -0500, wyndman
wrote:

I'm trying to have Excel run a macro I have written when a spreadsheet
is opend. I have a windows script that will open Excel for me, and the
spreadsheet I need, but so far I've had little luck getting the macro
to run. I've coded it into the actual sheet to run when it starts, but
it can never find the macro. :confused:


---
Message posted from http://www.ExcelForum.com/




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

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