none
How to read a variable of another application with a VBScript? RRS feed

  • Question

  • Hi,

    if I know the symbolic name (or the pointer) of a variable in a certain application, can I read it using VBS?

    I assume that's difficult in the case of an internal variable not meant to be passed outside of the application. Maybe it's easier in the case of a text displayed in a browser/API that can be selected and copied into the clipboard.

    Specifically, I'd like to import the calling phone number from the web interface of CISCO Finesse client into Excel for further processing. I can just copy and paste it manually, but automating the process with VBA/VBS would be much better.

    Thank you and best regards,

    Lurka

    Thursday, November 14, 2019 9:52 PM

All replies

  • This sounds like an XY problem.

    Are you asking if you can copy text from a web page using a script?


    -- Bill Stewart [Bill_Stewart]

    Thursday, November 14, 2019 10:39 PM
    Moderator
  • Specifically, I'd like to import the calling phone number from the web interface of CISCO Finesse client into Excel for further processing. 


    You will have to write a VBA macro to use the WinHTTP object to make requests to web site to "read" the web page and parse the data.

    Search the web for "Excel vba winhttp". 

    https://stackoverflow.com/questions/34663611/excel-vba-output-the-result-of-a-winhttprequest-in-excel

    Friday, November 15, 2019 1:54 AM
  • Thank you,

    to be clear, I'd like to import into Excel the phone number displayed in the image. The web page is updated in real time for every new call.

    Which forum is more suitable to ask for practical examples?

    Best regards,

    Lurka

    Friday, November 15, 2019 8:14 PM
  • That's going to depend on how that site does authentication (if any).

    That's not really something we can answer for you from afar in a forum. I'd recommend hiring a consultant if this is critical to business needs.


    -- Bill Stewart [Bill_Stewart]

    Friday, November 15, 2019 8:26 PM
    Moderator
  • Cisco has an API for retrieving data programmatically. Contact Cisco for this information.

    \_(ツ)_/

    Friday, November 15, 2019 9:12 PM
  • That's going to depend on how that site does authentication (if any).

    That's not really something we can answer for you from afar in a forum. I'd recommend hiring a consultant if this is critical to business needs.


    -- Bill Stewart [Bill_Stewart]

    The application authenticates with user and pass.

    I have just a personal interest to keep track of incoming calls and annotate them more efficiently in Excel, but the use of WinHTTP object is somewhat complicated.

    Do you think that a macro recorder utility for Windows could do the trick of automating the procedure of selecting and copying the value from the browser window?

    Thank you and best regards,

    Lurka

    Saturday, November 16, 2019 4:57 PM
  • Do you think that a macro recorder utility for Windows could do the trick of automating the procedure of selecting and copying the value from the browser window?

    The web page is updated in real time for every new call.

    If the web page displayed a table of all calls that occurred during the day, like in a row+column format, you should be able use the Excel function to import data from a web page. You use the Excel macro recording functions to create a macro to do that.

    If the data is just that one field and it changes every few minutes or every few seconds, then you are going to have set up some kind of polling of the web site to look for changed data. I don't think that Excel would be a good platform for doing that. A standalone C# program or Powershell script that made direct HTTP calls would make more sense.  That implies that the best solution is the suggestion made by jrv that you contact Cisco and ask them for help. They may already have a sample program that you could modify for your purposes.   

    Saturday, November 16, 2019 5:22 PM