Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When the Excel application is open with at least one workbook open
(Book1) and another existing Workbook (Book 2) is then opened (it doesn't matter which one), some volatile code in the first workbook will run before any events occur. I assume this means that the sheet recalculates and runs any volatile functions before any events occur. I would like to run some code before any existing code in the first workbook is executed, so that I can record the saved state of the workbook. According to my testing, based on Message Boxes in the various event proceedures, the first event that occurs is the Workbook_open event of the second workbook. All of the applicable Workbook and Application events occur after that, with the SheetCalculate events occuring last (and twice). According to my testing, the sequence of events that occur when the second workbook opens are as follows: Book 1: Volatile code executes (twice for each function call) Book 2: Workbook_Open Application: App_WorkbookOpen Book 1: Workbook_WindowDeactivate Application: App_WindowDeactivate Book 1: Workbook_Deactivate Application: App_WorkbookDeactivate Book 2: Workbook_Activate Application App_WorkbookActivate Book 2: Workbook_WindowActivate Application App_WindowActivate Book 1: Workbook_SheetCalculate Application: App_SheetCalculate Book 1: Workbook_SheetCalculate Application: App_SheetCalculate I am beginning to suspect that there is no event available to do what I want, but I'm hoping I'm wrong, and someone more familiar with the Excel architecture can tell me where to put my code. Michael Purcell |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. | Excel Discussion (Misc queries) | |||
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. | Setting up and Configuration of Excel | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel | |||
conditional formula to show "open" or "closed" | Excel Worksheet Functions |