Dir function on Excel 2011 for Mac

Discussion in 'Excel Programming' started by watergate74, Nov 3, 2012.

  1. watergate74

    watergate74 Guest

    Hello,

    I'm trying to write a script which returns all files and folders of a certain folder? This works fine on my Windoes pc but goes wrong on my broths Mac computer. Does anybody have an idea how to program this?

    Thank you in advance.

    watergate
     
    watergate74, Nov 3, 2012
    #1
    1. Advertisements

  2. watergate74

    isabelle Guest

    hi,


    In Microsoft Windows, The Dir function lets you use wildcards or
    wildcards (* or?) To select multiple files.
    On the Macintosh, these characters are considered characters valid file
    names and can not be used as wildcards to specify multiple files.

    Since the Macintosh does not support wildcards, use the file type to
    identify groups of files.
    You can use MacID to indicate the file type instead of file names. For
    example, the following statement returns the name of the first TEXT file
    in the current directory:

    Dir ("Path", MacID ("TEXT"))

    --
    isabelle


    Le 2012-11-03 10:11, watergate74 a ├ęcrit :
    > Hello,
    >
    > I'm trying to write a script which returns all files and folders of a certain folder?
    > This works fine on my Windoes pc but goes wrong on my broths Mac computer. Does anybody have an idea how to program this?
    >
    > Thank you in advance.
    >
    > watergate
     
    isabelle, Nov 3, 2012
    #2
    1. Advertisements

  3. watergate74

    BobJordanB

    Joined:
    Jun 23, 2014
    Messages:
    1
    Likes Received:
    0
    But be careful. For example an Excel file created on Mac will get a MacID of "XLSX".
    The identical file created on a PC and then moved to a Mac will have a MacID of ""

    I found out the hard way

    BobJordanB
     
    BobJordanB, Jun 26, 2014
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike Taylor
    Replies:
    0
    Views:
    199
    Mike Taylor
    Jul 13, 2003
  2. R Avery
    Replies:
    12
    Views:
    146
    R Avery
    Jul 19, 2004
  3. sal21

    space of single dir on a server dir

    sal21, Apr 3, 2007, in forum: Excel Programming
    Replies:
    2
    Views:
    214
  4. Michael Mueller

    Migration to Excel:Mac 2011, but what about the VBA projects?

    Michael Mueller, Dec 31, 2010, in forum: Excel Programming
    Replies:
    3
    Views:
    226
  5. Howard Brazee
    Replies:
    2
    Views:
    190
    Howard Brazee
    Apr 17, 2011
  6. Andrew Bourke

    LoadPicture command for excel 2011 for Mac

    Andrew Bourke, May 26, 2011, in forum: Excel Programming
    Replies:
    0
    Views:
    582
    Andrew Bourke
    May 26, 2011
  7. Drew
    Replies:
    0
    Views:
    205
  8. Drew
    Replies:
    1
    Views:
    1,082
Loading...