Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default run a macro when file is open

any one out there knows how to run a macro automatically in a workbook when
the workbook is open. I do not want the user to go to tools,macro,choose a
name and run the macro, what I am looking for is a way to run the macro
automatically. any one knows of a way to do this???? your comment is
appreciated
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default run a macro when file is open

On your spreadsheet in the upper left corner is the excel logo. Right click
it and select view code. This will open up the VB screen and you will be in
the ThisWorkbook object. Just above the Code window you will see a drop down
with the word General in it. Change that to Workbook. At this point it should
create some code in the Code window that looks like

Private Sub Workbook_Open()

End Sub

This procedure will fire when the workbook is opened so just call your
procedure from here like this

Private Sub Workbook_Open()
Call MyProcedure
End Sub

HTH

"nabil" wrote:

any one out there knows how to run a macro automatically in a workbook when
the workbook is open. I do not want the user to go to tools,macro,choose a
name and run the macro, what I am looking for is a way to run the macro
automatically. any one knows of a way to do this???? your comment is
appreciated

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default run a macro when file is open

can't you just fire your proc from Auto_Open?
"nabil" wrote in message
...
any one out there knows how to run a macro automatically in a workbook
when
the workbook is open. I do not want the user to go to tools,macro,choose a
name and run the macro, what I am looking for is a way to run the macro
automatically. any one knows of a way to do this???? your comment is
appreciated



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
Open Excel file from VB and open MACRO no1jimmyman Excel Discussion (Misc queries) 0 February 14th 11 10:10 PM
2007 Macro to Open File, Delete Contents, Save New File Flintstone[_2_] Excel Discussion (Misc queries) 2 February 1st 10 11:25 PM
ASP: Open Excel File with Macro, Allow Macro to run, and then save delgados129 Excel Programming 0 March 10th 05 09:35 PM
Automate open file, update links, run macro, close and save file Geoff[_7_] Excel Programming 2 August 26th 03 10:13 PM


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

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"