VBA Open a Specific File Type

  • Hi, I wonder whether someone could help me please.


    I'm trying to use the code below to open a specific file type, in this case '.dat'.



    The problem I have is that although the script runs, it's showing all the file types rather than the '.dat' files I want to show.


    Could someone perhaps tell me where I've gone wrong.


    Many thanks and kind regards


    Chris

  • Re: VBA Open a Specific File Type


    try below line of code:


    Code
    fName = Application.GetOpenFilename("DAT Files (*.dat), *.Dat")
  • Re: VBA Open a Specific File Type


    Hi MrRedli, thank you for taking the time to read my post and for coming back to me with this.


    Unfortunately though, although I'm not receiving any error message this still lists all the files rather than just the .dat files.


    Many thanks and kind regards


    Chris

Participate now!

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