+ Reply to Thread
Results 1 to 2 of 2

AppActivate

  1. #1
    BristolBloos
    Guest

    AppActivate

    Hi,

    I have sent this email yesterday but have not received any suggestions.
    May be I have not explained properly. Will try again.

    I have got a command button on my excel sheet which when pressed,
    initially, executes the following code:
    -----------------------------------------------
    AppActivate ("App1 ")
    Do
    Sleep 2000
    Loop Until UCase(Left(GetWinInfo, 9)) = "App1 "
    AppActivate ("App1 ")
    -----------------------------------------------

    The main purpose of executing the above code is to activate the
    application App1. App1 is not an excel workbook. It is our in-house
    application with several forms wherein users can key in their inputs.

    So, from my excel sheet, I basically want to activate App1 and show it
    on the screen. Later, using SendKeys, send some user commands onto App1
    form that is curently displayed.

    My code is working if I maximise App1 and set focus to it and then go
    to my excel sheet and press the command button.

    But, if App1 is minimised (not focus) then my code is not working.

    I am developing this macro for someone else to use it. Therefore I want
    it to run even when App1 is minimised and has no focus.

    I hope I have explained it properly this time.

    Therefore, I need some suggestions about how to achieve this task.

    Thanks & Regards,
    Prasad


  2. #2
    Bernie Deitrick
    Guest

    Re: AppActivate

    Prasad,

    You should consider

    1) using your in-house app as the dictator application, which controls Excel rather than the other
    way around. It's easy to do, since Excel's object is available through VBA.

    2) using Excel userforms to collect the same input.

    HTH,
    Bernie
    MS Excel MVP


    "BristolBloos" <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    >
    > I have sent this email yesterday but have not received any suggestions.
    > May be I have not explained properly. Will try again.
    >
    > I have got a command button on my excel sheet which when pressed,
    > initially, executes the following code:
    > -----------------------------------------------
    > AppActivate ("App1 ")
    > Do
    > Sleep 2000
    > Loop Until UCase(Left(GetWinInfo, 9)) = "App1 "
    > AppActivate ("App1 ")
    > -----------------------------------------------
    >
    > The main purpose of executing the above code is to activate the
    > application App1. App1 is not an excel workbook. It is our in-house
    > application with several forms wherein users can key in their inputs.
    >
    > So, from my excel sheet, I basically want to activate App1 and show it
    > on the screen. Later, using SendKeys, send some user commands onto App1
    > form that is curently displayed.
    >
    > My code is working if I maximise App1 and set focus to it and then go
    > to my excel sheet and press the command button.
    >
    > But, if App1 is minimised (not focus) then my code is not working.
    >
    > I am developing this macro for someone else to use it. Therefore I want
    > it to run even when App1 is minimised and has no focus.
    >
    > I hope I have explained it properly this time.
    >
    > Therefore, I need some suggestions about how to achieve this task.
    >
    > Thanks & Regards,
    > Prasad
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1