Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Utah, USA
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copy Data (Excel 2007)

    Does anyone know of a way to give focus to another object on my task bar so I can take data from my PC data base and input it to a Web based data baase?

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy Data (Excel 2007)

    Using what, your keyboard?, VBA? Mouse?
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Utah, USA
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy Data (Excel 2007)

    VBA

  4. #4
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Utah, USA
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy Data (Excel 2007)

    I've got a non-microsoft application open on my task bar and I to want to write an excel macro that will open or activate it (give it focus).

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Copy Data (Excel 2007)

    If you know the (first characters of) the title of the other application as displayed in the task bar and in the title bar of it window, you can use

    AppActivate "apptitle"

    where apptitle is enough of the title to uniquely identify the application.

  6. #6
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Copy Data (Excel 2007)

    If you know the window caption (the text displayed in the title bar), you can use something like:
    <pre>Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
    (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
    Sub GetWin()
    Dim lngRet As Long
    lngRet = FindWindow(vbNullString, "window caption here")
    SetForegroundWindow lngRet
    End Sub
    </pre>

    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

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