vba excel Error 76, path not found when the folder name is Persian

Samira Sarhadi 1 Reputation point


I want to open a file from my directory. when all folders name and the file name are English, everything is ok. but when I choose a folder that it's name contains Persian characters (just this two characters: "ی" and "ک") it returns Error 76: path not.
I checked the windows language and location setting on y windows, and it is ok.

thank you for your help.

Office Management
Office Management
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Management: The act or process of organizing, handling, directing or controlling something.
1,692 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Emi Zhang-MSFT 13,081 Reputation points Microsoft Vendor

    Hi @Samira Sarhadi ,
    Can you save as the file with the 2 characters: "ی" and "ک"?
    Did this problem only appear in Excel? How about other product? Try to save Word document and Text file.
    I suggest you open Excel- go to File- Options- Language, make sure you're using the correct language:


    Please be a bit more precise to explain your problem or you can upload a screenshot so that I can get more accurate solutions to this problem. I’m glad to help and follow up your reply.

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Samira Sarhadi 1 Reputation point

    hi @Emi Zhang-MSFT ,
    thank you so much
    my language settings are correct

        Fname = Application.GetOpenFilename(MultiSelect:=True)  
        For K = LBound(Fname) To UBound(Fname)  
            If Right(Fname(K), 4) = ".txt" Then  
                Open Fname(K) For Input Access Read As #1  
            End If  
        Next K  

    I use this cod to open a text file
    if all folders name doesn't contain "ی" and "ک" every thing is ok.

    0 comments No comments

  3. Viorel 95,076 Reputation points

    Add a reference to "Microsoft Scripting Runtime" and try an alternative (instead of Open Fname(K)...):

    Dim fso As Scripting.FileSystemObject  
    Dim ts As Scripting.TextStream  
    Set fso = New Scripting.FileSystemObject  
    Set ts = fso.OpenTextFile(Fname(K), ForReading, False, TristateUseDefault)  
    Dim allText As String  
    allText = ts.ReadAll  
    MsgBox allText