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

Does anyone know how to run a macro automatically when excel opens?

Surely this should be simple (it is simple to start a query in access
when you open it)

I am a beginner using VB code in excel.

Hope someone can help.

Thanks

Vman


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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Runnig a macro when excel opens

to run a macro upon opening a workbook you need to create a macro in th
'ThisWorkbook' object (see top left of VB Editor screen and doubl
click 'ThisWorkbook').

e.g. to show a userform upon opening I have used the following:

Private Sub Workbook_Open()
Quote_Details.Show
End Sub

Hope that help

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Runnig a macro when excel opens

If you want a macro to run when Excel opens, no matter what workbook you are
opening, I believe you'll need to put the macro in the PERSONAL.XLS
workbook, which opens and is hidden every time Excel opens. To create
PERSONAL.XLS, record a macro and choose to create it in PERSONAL.XLS. If
the workbook doesn't exist Excel will create it that time and it will then
always open whenever Excel opens. Put the macro in the Workbook_Open event
handler.

-gk-

"vman" wrote in message
...
Does anyone know how to run a macro automatically when excel opens?

Surely this should be simple (it is simple to start a query in access
when you open it)

I am a beginner using VB code in excel.

Hope someone can help.

Thanks

Vman


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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Runnig a macro when excel opens

I think that I have done exactly as described, in an empty worksheet,
assuming that the instructions were exact and complete.
After saving the workbook and reopening it I get the following error:-
Run-time error '424'
Object required

What am I doing wrong?
Do the instructions omit some detail that I am assumed to know?
What should I expect to see?

Thanks for any help
Brian Tozer

cornishbloke wrote:
to run a macro upon opening a workbook you need to create a macro in
the 'ThisWorkbook' object (see top left of VB Editor screen and double
click 'ThisWorkbook').

e.g. to show a userform upon opening I have used the following:

Private Sub Workbook_Open()
Quote_Details.Show
End Sub



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
Run Macro Automatically When Excel 2003 Opens CBender Excel Discussion (Misc queries) 2 May 7th 10 05:25 PM
Auto adding a macro when Excel 2003 opens gigabyteconsulting Excel Discussion (Misc queries) 4 July 6th 09 08:57 PM
Excel file opens and opens and opens Wanna Learn Excel Discussion (Misc queries) 1 June 9th 09 11:03 PM
Runnig macros in background mode Tom Ogilvy Excel Programming 0 August 6th 03 06:49 PM
Runnig macros in background mode Chip Pearson Excel Programming 0 August 6th 03 06:47 PM


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

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

About Us

"It's about Microsoft Excel"