Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add-in to run macro when ANY workbook is opened?
i would like to create an add-in that runs when any workbook is opened I didnt think i could use the workbook_open code b/c that would have t reside in the individual workbooks, am i wrong in that assumption? thanks -- jrupper ----------------------------------------------------------------------- jruppert's Profile: http://www.excelforum.com/member.php...nfo&userid=317 View this thread: http://www.excelforum.com/showthread.php?threadid=27560 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add-in to run macro when ANY workbook is opened?
You need to create an application-level event.
see Chip Pearson's page at http://www.cpearson.com/excel/AppEvent.htm Charles ______________________ Decision Models FastExcel 2.1 now available www.DecisionModels.com "jruppert" wrote in message ... i would like to create an add-in that runs when any workbook is opened. I didnt think i could use the workbook_open code b/c that would have to reside in the individual workbooks, am i wrong in that assumption? thanks. -- jruppert ------------------------------------------------------------------------ jruppert's Profile: http://www.excelforum.com/member.php...fo&userid=3170 View this thread: http://www.excelforum.com/showthread...hreadid=275605 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add-in to run macro when ANY workbook is opened?
You'll have to set a reference to the application object AND monitor the application events. You could create a classmodule but following is simpler. in the addin's Thisworkbook object module: Option Explicit Dim WithEvents xlApp As Application Private Sub Workbook_Open() Set xlApp = Application End Sub Private Sub xlApp_SheetSelectionChange(ByVal Sh As Object, _ ByVal Target As Range) If Target.Address < "$A$1" Then Sh.Cells(1).Select End If End Sub instantiate the xlapp variable by running the workbook_open procedure (once) then try to navigate your workbooks :) keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool jruppert wrote : i would like to create an add-in that runs when any workbook is opened. I didnt think i could use the workbook_open code b/c that would have to reside in the individual workbooks, am i wrong in that assumption? thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to run a macro as soon a a workbook (.xls) is opened? | Excel Worksheet Functions | |||
Macro to Record date workbook is first opened | Excel Programming | |||
Looking for a way to run a macro when the workbook is opened | Excel Programming | |||
Run a macro when a workbook is opened | Excel Programming | |||
Run a macro when a workbook is opened | Excel Programming |