Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Get range value active workbook on open add-in

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
When I open a workbook, cell protection is not fully active Dave_B_at C&W Excel Worksheet Functions 0 February 4th 09 10:42 AM
how to open a workbook per active window Jackie[_2_] Excel Discussion (Misc queries) 1 August 19th 08 11:13 PM
Why does a new Excel Workbook open with IV1 as the active cell? pjwing Excel Discussion (Misc queries) 1 July 3rd 07 11:26 PM
Copy worksheet from Active workbook into all other open workbooks TroyB[_2_] Excel Programming 0 February 10th 04 10:29 AM
How do I make an open workbook the active workbook Don Guillett[_4_] Excel Programming 0 December 30th 03 04:28 PM


All times are GMT +1. The time now is 03:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"