Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Trap SheetBeforeRightClick event from another workbook

I have an xla (workbook a) that loads when excel starts. The xla
contains forms, classes and modules that are used to validate and load
data via a web service.

The data is coming from another workbook (workbook b) that is either
loaded into excel on demand through the normal file/open menu, or the
user may have double-clicked the file icon in windows explorer or
wherever. In either case, the workbook is open in the same instance of
excel as the xla.

My problem is that I must trap the double-click event of the workbook
that holds the data. The "ThisWorkbook" module holds that event, and I
cannot put any executable code in the event handler.

I have tried using a technique that involves creating a class and
declaring a WithEvents within that class similar to the following:

Public WithEvents actvWkBk as Workbook

that does not seem to work.

So the double-click event of workbook b, must somehow be trapped in
workbook a.

Any help will be greatly appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Trap SheetBeforeRightClick event from another workbook


you need application level events.
see http://www.cpearson.com/excel/AppEvent.htm


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


mp112849 wrote :

I have an xla (workbook a) that loads when excel starts. The xla
contains forms, classes and modules that are used to validate and load
data via a web service.

The data is coming from another workbook (workbook b) that is either
loaded into excel on demand through the normal file/open menu, or the
user may have double-clicked the file icon in windows explorer or
wherever. In either case, the workbook is open in the same instance
of excel as the xla.

My problem is that I must trap the double-click event of the workbook
that holds the data. The "ThisWorkbook" module holds that event, and I
cannot put any executable code in the event handler.

I have tried using a technique that involves creating a class and
declaring a WithEvents within that class similar to the following:

Public WithEvents actvWkBk as Workbook

that does not seem to work.

So the double-click event of workbook b, must somehow be trapped in
workbook a.

Any help will be greatly appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Trap SheetBeforeRightClick event from another workbook

Thanks, keepITcool! This works when I open the data file with a
double-click from windows explorer. I haven't had a chance to try it
while opening the file once an instance of excel is running (from a
file/open), but will do that later.

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
Trap show toolbar event [email protected] Links and Linking in Excel 0 April 27th 07 04:16 PM
How to trap delete row event and hide column event? Alan Excel Programming 3 April 26th 05 04:25 PM
How can i trap the rename event of an excel sheet? bmm Excel Programming 4 August 10th 04 03:51 PM
Trap CTRL+C keypress event Nick Excel Programming 4 January 30th 04 09:17 PM
how to trap a event coming from a dll E.Anderegg Excel Programming 6 October 16th 03 01:53 PM


All times are GMT +1. The time now is 11:54 AM.

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

About Us

"It's about Microsoft Excel"