Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Run-Time Error 75 "Path/File Access Error"

  1. #1
    New Member
    Join Date
    Jan 2008
    Location
    Brooklyn
    Posts
    26
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Run-Time Error 75 "Path/File Access Error"

    Hi All,

    I'm encountering Run time error 75 on the below code. In the excel macro, when the file is not found the below codes run to save the excel workbook,

    Dim a
    a = MsgBox("Location not Found. Do you want to create this location?", vbCritical + vbYesNo, "Error")
    If a = vbYes Then
    MkDir "A:\KNITS\Season\" & Season & "\" & SeaYr & "\" & Category
    MkDir "F:\KNITS\Season\" & Season & "\" & SeaYr & "\" & Category & "\" & Vndr
    ActiveWorkbook.SaveAs "F:\KNITS\Season\" & Season & "\" & SeaYr & "\" & Category & "\" & Vndr & "\" & Fname & ".xls"

    Else
    End
    End If


    Fname refers to the excel file I'm saving,

  2. #2
    Board Regular
    Join Date
    May 2009
    Location
    Massachusetts
    Posts
    70
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Run-Time Error 75 "Path/File Access Error"

    What does the fName look like? Do you already have an ".xls" at the end of the file name? If you do, then adding another one in the code will cause you some problems (in essence, you'd be saving ".xls.xls").

    Scott

  3. #3
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    32,173
    Post Thanks / Like
    Mentioned
    24 Post(s)
    Tagged
    3 Thread(s)

    Default Re: Run-Time Error 75 "Path/File Access Error"

    At a guess your problem may be the drive letter:
    Code:
    MkDir "A:\KNITS\Season\" & Season & "\" & SeaYr & "\" & Category
    MkDir "F:\KNITS\Season\" & Season & "\" & SeaYr & "\" & Category & "\" & Vndr

  4. #4
    New Member
    Join Date
    Jan 2008
    Location
    Brooklyn
    Posts
    26
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Run-Time Error 75 "Path/File Access Error"

    FNAME is text

    Fname = frmSaveas.txtFname.Text

    I'll add some more code so you see where i'm going

    When you fill out the user form it will save the file here
    ActiveWorkbook.SaveAs "F:\KNITS\Season\" & Season & "\" & SeaYr & "\" & Category & "\" & Vndr & "\" & Fname & ".xls"
    .
    MsgBox "File Saved", vbInformation, "Sucessful"

    frmSaveas.Hide

    Exit Sub

    If the location is not found then it runs the below code,

    ErrorHandler:

    frmSaveas.Hide

    Dim a
    a = MsgBox("Location not Found. Do you want to create this location?", vbCritical + vbYesNo, "Error")
    If a = vbYes Then
    MkDir "F:\KNITS\Season\" & Season & "\" & SeaYr & "\" & Category
    MkDir "F:\KNITS\Season\" & Season & "\" & SeaYr & "\" & Category & "\" & Vndr
    ActiveWorkbook.SaveAs "F:\KNITS\Season\" & Season & "\" & SeaYr & "\" & Category & "\" & Vndr & "\" & Fname & ".xls"
    'frmSaveas.Show
    Else
    End
    End If

  5. #5
    Board Regular
    Join Date
    May 2009
    Location
    Massachusetts
    Posts
    70
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Run-Time Error 75 "Path/File Access Error"

    Quote Originally Posted by rorya View Post
    At a guess your problem may be the drive letter:
    Code:
    MkDir "A:\KNITS\Season\" & Season & "\" & SeaYr & "\" & Category
    MkDir "F:\KNITS\Season\" & Season & "\" & SeaYr & "\" & Category & "\" & Vndr

    Good point. Not the F: drive, though, but the A: drive, since A: drives are historically floppy disks.

    Scott

  6. #6
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    32,173
    Post Thanks / Like
    Mentioned
    24 Post(s)
    Tagged
    3 Thread(s)

    Default Re: Run-Time Error 75 "Path/File Access Error"

    Could be either (there are still people using floppies, bizarrely), but should be consistent!

  7. #7
    Board Regular
    Join Date
    May 2009
    Location
    Massachusetts
    Posts
    70
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Run-Time Error 75 "Path/File Access Error"

    The problem may be in the file name. If it starts out as a text file (.txt) you may need to strip out the extension .txt so that you can concatenate it later in the code with .xls.

    Scott

  8. #8
    Board Regular
    Join Date
    May 2009
    Location
    Massachusetts
    Posts
    70
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Run-Time Error 75 "Path/File Access Error"

    What's "floppy"? For that matter, what's a "zip" drive?

    Scott

  9. #9
    Board Regular
    Join Date
    May 2009
    Location
    Massachusetts
    Posts
    70
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Run-Time Error 75 "Path/File Access Error"

    But even is the A: drive is a mapped network drive, the second MkDir for the F: drive should take care of the location. Right? Actually, I've never considered that: do you need a MkDir command for every folder level you create, or can you just use one command to cover it?

    Scott

  10. #10
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    32,173
    Post Thanks / Like
    Mentioned
    24 Post(s)
    Tagged
    3 Thread(s)

    Default Re: Run-Time Error 75 "Path/File Access Error"

    My PC at home has 2 floppy drives and a Zip drive!

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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