+ Reply to Thread
Results 1 to 4 of 4

Making VBA add in available to all workbooks

  1. #1
    Registered User
    Join Date
    06-20-2007
    Posts
    3

    Making VBA add in available to all workbooks

    I have writtem some VBA code that is attached to a sheet which reacts the a cell change:

    Sub Worksheet_Change(ByVal target As Range)

    However, I actually want to write an add in that will react to any cell change event regardless of the sheet or workbook (or excel file) worked on. Think of my add in as a logger that logs every cell change in excel (primarily in terms of value but other properties are fine too)

    Any thoughts on how to achieve this?
    Thanks,
    Raj

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    A worksheet-change event has to be in the workbook that is changing. I'm not sure what or why you would want to log with an addin
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    06-20-2007
    Posts
    3
    Although my initial plan is to just log each change to a file, eventually I would like to send the event to a server (hence I am looking for a way, be it VBA or some other excel API to be able to catch all events regardless of the workbook loaded such that I can convey changes to the files being edited to a remote location).

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    You can create an application event.
    1)Insert a code module, use the properties window to change its name to appEvent, and put this code in it.
    Please Login or Register  to view this content.
    2) Put this in a normal code module
    Please Login or Register  to view this content.
    startUp needs to run to declare the application event, so this in ThisWorkbook
    Please Login or Register  to view this content.
    The your code will run whenever a cell is changed in any open workbook.

+ 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