Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run Macro Automatically When Excel 2003 Opens | Excel Discussion (Misc queries) | |||
Auto adding a macro when Excel 2003 opens | Excel Discussion (Misc queries) | |||
Excel file opens and opens and opens | Excel Discussion (Misc queries) | |||
Runnig macros in background mode | Excel Programming | |||
Runnig macros in background mode | Excel Programming |