Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. VBA Event handling

VBA Event handling

Scheduled Pinned Locked Moved Visual Basic
question
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    macmac38
    wrote on last edited by
    #1

    Hello, i like to handle an event from an included libary: I use this code in my VBA project form1: Private WithEvents mScandata As RealScan ------------------------------------------ Private Sub Form_Load() Set mScandata = New RealScan End Sub ------------------------------------------ Private Sub mScandata_ScanReady(ByVal pDobj As SCANNERLib.IDataObject) Dim i As Long For i = 0 To 250 MessageBeep (i) Next End Sub ------------------------------------------ This code doesen' t work. Does anybody has experience with event handling in vb? I think the prob is to initiate the m_Scandata event? happy coding, -mark

    D 1 Reply Last reply
    0
    • M macmac38

      Hello, i like to handle an event from an included libary: I use this code in my VBA project form1: Private WithEvents mScandata As RealScan ------------------------------------------ Private Sub Form_Load() Set mScandata = New RealScan End Sub ------------------------------------------ Private Sub mScandata_ScanReady(ByVal pDobj As SCANNERLib.IDataObject) Dim i As Long For i = 0 To 250 MessageBeep (i) Next End Sub ------------------------------------------ This code doesen' t work. Does anybody has experience with event handling in vb? I think the prob is to initiate the m_Scandata event? happy coding, -mark

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      The qeustion should be has anyone ever done anything with the RealScan library? And from what I can tell when searching for RealScan, that's not very likely. Handling events in VB/VBA/VB.Net is so common it happens in virtually every app everyone writes. It LOOKS like everything is OK. There are many possibilities as to why your having a problem with it. The signature of the event handler could be wrong, the documentation on the library could be wrong, the library firing the event when it's supposed to and your not looking for it at that time, or you expecting the event when the library is not supposed to fire it, or are you supposed to call an initlization function after you create the object... The list goes on and on... RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups