Check if folder exists with VBA

Поділитися
Вставка
  • Опубліковано 20 лис 2015
  • How to check if a folder exists with VBA. We can use both the DIR function or the File System Object. Let's also see the main difference in using both the approaches.
    Details available at my website:
    www.exceltrainingvideos.com/ch...

КОМЕНТАРІ • 7

  • @avulashivaprasad4532
    @avulashivaprasad4532 Рік тому

    Hi Sir,
    Out of multiple folders how can I look for the one specific folder with the help of a path one particular date and how to write code for that.

  • @jackpun3024
    @jackpun3024 8 років тому

    Thanks for the video.

  • @sumanpaul1948
    @sumanpaul1948 3 роки тому

    Hi, I am facing trouble to check the existing file in a specific folder. Because I am creating the file name automatically with a specific cell reference. Could you please help to get the VBA code to check if the file exists? Here I am showing my file path: [[ActiveSheet.Range("A1:O102").ExportAsFixedFormat xlTypePDF, FileName:="C:\Levi's Recipe\" & ActiveSheet.Range("P1").Value, openafterpublish:=True]] Thanks in advance.

  • @mukenyibadibanga1697
    @mukenyibadibanga1697 4 роки тому

    Hi. How do you check if a hidden folder exists? Thanks.

    • @Exceltrainingvideos
      @Exceltrainingvideos  4 роки тому

      First check if the folder exists. Next check for the file attributes.

    • @mukenyibadibanga1697
      @mukenyibadibanga1697 4 роки тому

      @@Exceltrainingvideos Thank you so much for reverting. It worked perfectly fine. If Dir(myFolder, vbDirectory or vbHidden). I was missing to add OR VBHIDDEN.