VBA User Form to open file not setting focus on the opened file

  1. t.gatheru
    t.gatheru
    I have created a User form with different buttons to open the various files. However, when I click a button to open a specific file, the opened file is not automatically activated (set focus).
    How do get the last opened file activated?

    If I click the button pmt (below) to open a payment file, Excel does not activate the pmt file opened but the focus remains on book 1 (or the previously open workbook)




    I have created the following 3 codes to open the "pmt" file


    Sub Open_Selected()

    fmOpenFiles.Show

    End Sub


    Private Sub cmdPayments_Click()
    Open_Payments
    Unload Me
    End Sub


    Sub Open_Payments()

    Dim file As String

    file = "D:\My files\Payments.xlsx"

    Workbooks.Open filename:=file

    End Sub
Results 1 to 1 of 1

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1