Stopping opening same worksheet

  • Re: how to stop


    Hi Ben,
    The problem in my workbook that every time I try to put an error-handling features to stop the same worksheet from opening, it still opens the worksheet but it name differently but the information contain in the worksheet is the same. So I want to stop it from opening the worksheet. Here's the code I was using:



    Kim

  • Re: Stopping opening same worksheet


    Hi roy,
    That code there always be highlighted by the run-time error. So here is the code:

    Code
    'open target workbook
        On Error Resume Next
        Workbooks.Open Application.DefaultFilePath & "\" & find1 & "\" & WK2
        'locate worksheet
        If Err.Number <> 0 Then
        MsgBox "Invalid input"
        Unload Me
        uf4.Show 'False
        End If
        On Error GoTo 0



    kim

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!