+ Reply to Thread
Results 1 to 3 of 3

Trap SheetBeforeRightClick event from another workbook

  1. #1
    mp112849
    Guest

    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. #2
    keepITcool
    Guest

    Re: 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. #3
    mp112849
    Guest

    Re: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1