Get range value active workbook on open add-in
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
|