Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default 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.


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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default 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.


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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
AutoRun Macro chrisnsmith Excel Worksheet Functions 5 February 4th 09 07:25 PM
autorun a macro [email protected] New Users to Excel 2 January 24th 08 05:41 PM
Autorun macro Kelly Excel Worksheet Functions 1 January 18th 06 04:03 PM
MACRO AUTORUN b52shut Excel Discussion (Misc queries) 1 December 15th 05 08:48 AM
Autorun macro on opening spreadsheet simonjackson79 Excel Programming 3 November 5th 03 02:22 PM


All times are GMT +1. The time now is 02:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"