+ Reply to Thread
Results 1 to 9 of 9

Events issues

  1. #1
    Registered User
    Join Date
    07-25-2012
    Location
    Paris, France
    MS-Off Ver
    Excel 2010
    Posts
    22

    Events issues

    Hi,

    I got a problem with the events... i'm probably doing wrong but... i can't find what is wrong!!

    Here's an example file, if someone can help me EVENEMENTS.xlsm

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Events issues

    That looks fine to me, what are you expecting to happen?

    Actually, scrap that, you haven't declared your classes properly.

    Classe2:
    Please Login or Register  to view this content.
    you should really be using option explicit
    Last edited by Kyle123; 08-28-2012 at 12:26 PM.

  3. #3
    Registered User
    Join Date
    07-25-2012
    Location
    Paris, France
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Events issues

    well i'm not using option explicit because it's an example file and i did it quickly so... my code is a bit dirty lol
    Basically, why when my procedure in classe1 raise the event, why my procedure associated to the event in my class 2 does not start :/ it should display a msgbox...

  4. #4
    Registered User
    Join Date
    07-25-2012
    Location
    Paris, France
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Events issues

    ok, i've understand where i missed. my object must have the same name as in the declaration... logical... but I have another problem in my real code. my object are stocked in a collection... So how can I declare them??? :o

  5. #5
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Events issues

    It might be better to describe what you're actually trying to do.

    You'd need somewhere to actually put the sub that's run when the event is raised

  6. #6
    Registered User
    Join Date
    07-25-2012
    Location
    Paris, France
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Events issues

    well it's exactly the same construction as the following example :

    Please Login or Register  to view this content.
    Company -> staff crew -> collection of employees

    and i'll have an event raised by an employee, and i want it to be recieved by the staff crew. How can I do it??

    thank's

  7. #7
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Events issues

    A bit more background would be useful. For example, if you could do what you are proposing - which I don't think you can. How would you know which Employee raised the event?

  8. #8
    Registered User
    Join Date
    07-25-2012
    Location
    Paris, France
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Events issues

    the event will return the id of the employee

  9. #9
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Events issues

    Ok, fair enough, have a look here

    http://www.mvps.org/vbvision/collection_events.htm

+ 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