Results 1 to 11 of 11

Thread: Run-Time error -- GetOpenFilename / Open Browse Box

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Run-Time error -- GetOpenFilename / Open Browse Box

    I am gettting an error:

    Method 'GetOpenFilename' of object '_Application' failed

    The strange thing is that it works fine on a PC. Same versions of Office.

    Here is my code:

    Dim fname As Variant
    Dim FNUM As Long
    Dim SLINE As String
    Dim I As Long
    Dim RW As Long
    fname = Application.GetOpenFilename(filefilter:="TEXT FILES (*.TXT), *.TXT")
    If fname <> False Then
        FNUM = FreeFile()
        Open fname For Input As #FNUM
        Do While Not EOF(FNUM)
            Line Input #FNUM, SLINE
            RW = RW + 1
            For I = 1 To Len(SLINE)
                Cells(RW, I).Value = Mid(SLINE, I, 1)
            Next
        Loop
    Last edited by Aussiebear; 01-11-2025 at 01:49 AM.

Posting Permissions

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