Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
It sounds like you need to install a class module to trap and monitor when a workbook is opened. You can then also check the value in cell A1 and run procedures accordingly. Something like this: Private Sub ClassApp_WorkbookActivate(ByVal Wb As Workbook) Select Case Wb.Name Case Name1 do things here Case Name2 do things here End Select End Sub or Private Sub ClassApp_SheetActivate(ByVal Sh As Object) if activesheet = workbooks("Whatever.xls").Sheets(1) then end if End Sub HTH Andrew Bourke RB Smissaert wrote: Have the following situation: One installed add-in. When Excel starts this add-in will open (but not install) another add-in. Now when this second add-in opens I want it to get the value of cell A1 in sheet 1 of the active workbook. This now turns out to be very difficult. It somehow has to work with the open event of the second add-in. The problem is that this second add-in gets opened before the sheet of the active workbook is there. I have tried with all kind of waiting loops, but no success sofar. The idea is that when a particular workbook gets opened by double-clicking it the second add-in will run code depending on the value in cell A1 of the active workbook. Thanks for any advice. RBS |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks.
I had a go with that from an example of Chip Pearson, but couldn't get it to work. Will try again. RBS "Ajtb" wrote in message ... Hi It sounds like you need to install a class module to trap and monitor when a workbook is opened. You can then also check the value in cell A1 and run procedures accordingly. Something like this: Private Sub ClassApp_WorkbookActivate(ByVal Wb As Workbook) Select Case Wb.Name Case Name1 do things here Case Name2 do things here End Select End Sub or Private Sub ClassApp_SheetActivate(ByVal Sh As Object) if activesheet = workbooks("Whatever.xls").Sheets(1) then end if End Sub HTH Andrew Bourke RB Smissaert wrote: Have the following situation: One installed add-in. When Excel starts this add-in will open (but not install) another add-in. Now when this second add-in opens I want it to get the value of cell A1 in sheet 1 of the active workbook. This now turns out to be very difficult. It somehow has to work with the open event of the second add-in. The problem is that this second add-in gets opened before the sheet of the active workbook is there. I have tried with all kind of waiting loops, but no success sofar. The idea is that when a particular workbook gets opened by double-clicking it the second add-in will run code depending on the value in cell A1 of the active workbook. Thanks for any advice. RBS |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
When I open a workbook, cell protection is not fully active | Excel Worksheet Functions | |||
how to open a workbook per active window | Excel Discussion (Misc queries) | |||
Why does a new Excel Workbook open with IV1 as the active cell? | Excel Discussion (Misc queries) | |||
Copy worksheet from Active workbook into all other open workbooks | Excel Programming | |||
How do I make an open workbook the active workbook | Excel Programming |