Results 1 to 2 of 2
  1. #1
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480

    sendkeys, anyone have experience?

    So, I have avoided sendkeys for along time now. Now I am being asked to navigate a program, IEX totalview. The only way I can think of making this program boogie is with using send keys... However, it is so inconsistent that I almost want to say it is not possible... But here is the code..

    Code:
    Sub TotalView()
    
    
    
    
    
    
    Dim User, Pass As String
    User = DLookup("[chrWebuser]", "tblWebCreds", "chrWebTools='Total View'")
    Pass = DLookup("[chrWebpass]", "tblWebCreds", "chrWebTools='Total View'")
    
    
            ChDir "C:\Program Files\CCapps\ttlview\bin"
            Shell "C:\Program Files\CCapps\ttlview\bin\ttlview.exe"
            
            PauseApp 3
            SendKeys User, True
            PauseApp 0.5
            SendKeys ("{TAB}"), True
            PauseApp 0.5
            SendKeys Pass, True
            PauseApp 0.3
            SendKeys ("{TAB}"), True
            PauseApp 0.3
            SendKeys ("~"), True
            PauseApp 0.3
            SendKeys ("!T"), True
            PauseApp 0.3
            SendKeys ("!M"), True
            PauseApp 0.3
    
    
    End Sub
    I added the pauseapp, so the code did not get ahead of itself.. however its not very successful. Does anyone know of anyway to make this process function better? Or a different method for communicating with a non microsoft program running on windows? I was thinking DDE possibly, but I have no idea how to do that in this case... Any recommendations are appreciated.

  2. #2
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    So I adjusted my timeouts... and it seems to be performing a little better...


    Code:
    Sub TotalView()
    
    
    Dim User, Pass As String
    User = DLookup("[chrWebuser]", "tblWebCreds", "chrWebTools='Total View'")
    Pass = DLookup("[chrWebpass]", "tblWebCreds", "chrWebTools='Total View'")
    
    
            ChDir "C:\Program Files\CCapps\ttlview\bin"
            Shell "C:\Program Files\CCapps\ttlview\bin\ttlview.exe"
            
            PauseApp 2
            SendKeys User, True
            PauseApp 0.5
            SendKeys ("{TAB}"), True
            PauseApp 0.75
            SendKeys Pass, True
            PauseApp 0.5
            SendKeys ("{TAB}"), True
            PauseApp 0.5
            SendKeys ("~"), True
            PauseApp 1.5
            SendKeys ("%"), True
            PauseApp 0.5
            SendKeys ("T"), True
            PauseApp 0.5
            SendKeys ("M"), True
            PauseApp 0.5
            SendKeys ("~"), True
    
    
    End Sub
    however I REALLY don't like this sendkeys nonsense

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Need someone with experience to develop for me
    By getrichschemer in forum Access
    Replies: 3
    Last Post: 09-21-2011, 05:14 PM
  2. Sendkeys replacement
    By numberguy in forum Programming
    Replies: 6
    Last Post: 07-14-2011, 08:29 AM
  3. Programming experience, but no access experience
    By redfox1160 in forum Access
    Replies: 6
    Last Post: 03-07-2011, 03:48 PM
  4. Fulltime Access Developer with Finance experience
    By tchandler in forum General Chat
    Replies: 1
    Last Post: 12-20-2010, 04:03 PM
  5. Sendkeys replacement
    By numberguy in forum Forms
    Replies: 3
    Last Post: 10-29-2010, 07:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums - Senior Forums