General discussion

  • Creator
    Topic
  • #2131148

    Loss of focus when recording VB macros

    Locked

    by jeffrey willits ·

    I wish to record a macro in Microsoft Project 2000 that starts a companion product’s macro (ProChain Solutions) and marks a checkbox in ProChain’s form. Unfortunately, Project’s macro recorder gives up the focus when ProChain’s form is opened. Is there a trick to keeping the macro recorder recording in such a situation?

All Comments

  • Author
    Replies
    • #3569381

      Loss of focus when recording VB macros

      by dklippert ·

      In reply to Loss of focus when recording VB macros

      You could use SendKeys.
      Here?s a sample from the VB Help file:

      Dim ReturnValue, I
      ‘ Run Calculator.
      ReturnValue = Shell(“CALC.EXE”, 1)
      ‘ Activate the Calculator.
      AppActivate ReturnValue
      ‘ Set up counting loop.
      For I = 1 To 100
      ‘ Send keystrokes to Calculator
      ‘ to add each value of I.
      SendKeys I & “{+}”, True

      Next I
      ‘ Get grand total.
      SendKeys “=”, True
      ‘ Send ALT+F4 to close Calculator.
      SendKeys “%{F4}”, True

    • #3568891

      Loss of focus when recording VB macros

      by jeffrey willits ·

      In reply to Loss of focus when recording VB macros

      This question was closed by the author

Viewing 1 reply thread