Results 1 to 5 of 5

Thread: Excel Interacting With Another Non-Office Application

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Jul 2013
    Posts
    4
    Rep Power
    0

    Excel Interacting With Another Non-Office Application

    I want to run reports in another application (Avaya) and paste results into Excel. I did this several years ago with Excel 2003 in an earlier OS but can't get it to work now.

    I manually open four reports in Avaya, and when I click the Excel button (on the sheet I want the reports pasted to) it checks if the reports are open. If any aren't, it tells me to, then to restart.

    If successful checking for the necessary Avaya reports, Excel then prompts me for a date, and sends the date to the first Avaya report with Sendkeys and DoEvents, then runs the report and copies the results to the clipboard. Then it goes back to Excel, paste the results, and asks for the next set of Avaya data.

    The problem seems to be that the lingo used in Excel 2003 to interact with another application does not work with Excel 2010, or does not work with Windows WP Professional and Windows 7 Enterprise (one on each computer), or both.

    Apparently part of my Excel 2003 code that isn't understood by what I'm using now

    Code:
    AppActivate Calls1
        Do While FindWindow(vbNullString, Calls1) = 0
        DoEvents
        Loop
        SendKeys "%r+%r", True
        DoEvents
        SendKeys "{tab 2}" + When, True
        DoEvents
        SendKeys "%w+{tab}", True
        DoEvents
    "AppActivate Calls1" does indeed activate the appropriate window of the Avaya application. But Excel apparently doesn't understand the "FindWindow(vbNullString, Calls1) = 0" statement. When I put the cursor on FindWindow and press F1 I get the message "Object library invalid or contains references to object definitions that could not be found." Tools/References in the VB window shows no obvious problems.

    What I am trying to do is put the focus on another app window (Calls1), then send keystrokes to it. The problem is that the SendKeys statement is sending those commands to the VB window, not to the Calls1 application that was activated (which it had done correctly in Excel 2003). Any ideas?
    Last edited by Admin; 07-02-2013 at 07:39 AM.

Similar Threads

  1. Add VBA Reference From Another Application Excel To PowerPoint
    By ds1001 in forum Rajan Verma's Corner
    Replies: 1
    Last Post: 06-02-2013, 02:43 PM
  2. Replies: 1
    Last Post: 02-14-2013, 11:08 AM
  3. Replies: 2
    Last Post: 12-04-2012, 02:05 PM
  4. Using Office.CommandBar
    By Rasm in forum Excel Help
    Replies: 2
    Last Post: 12-03-2011, 06:04 AM
  5. Excel Application.OnKey With Parameter
    By Excel Fox in forum Excel Help
    Replies: 0
    Last Post: 11-29-2011, 01:31 PM

Posting Permissions

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