Results 1 to 2 of 2

Thread: Listening to Events with Script

  1. #1
    junfanbl is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.5
    Join Date
    Feb 2016

    Listening to Events with Script

    Hey everyone, I am curious to know whether or not it is possible to use a script to listen to listen for an event. To be more specific I am trying to monitor Excel for certain events to take place, and when they do I need to write data to a port over a remote server. My first thought is to run the script using a Do While loop to check for events. Running the script in a loop in the background shouldn't be that much of a performance hog (at least I don't think) because I'm running a beast of a machine. Plus the script is running on it's own thread so I'm hoping that making it loop in the background won't have performance issues. (If you think otherwise please let me know).

    The other issue I'm concerned with however is that while the script "listens" for an event in Excel by handling the application object;

      Dim objExcel as Object = ("Excel.Application")
    Using that Instance of Excel (to initiate the event) might make the script crash. I have experienced this before while using scripts to handle processing in Excel where while it was writing data to the sheet I couldn't click in a cell otherwise the script would crash.

    I can't compile executable files or use VSTO unfortunately because of work restrictions. I am however given permission to run a certain scripting environment.

  2. #2
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.5
    Join Date
    Dec 2005
    This question regards only VBA, as such you have to ask in a VBA forum because this place is for VB.Net development only. Thread is therefore closed.
    How to format posts with code blocks etc - present the problem/post properly

    Visual Studio Community 2017


Posting Permissions

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