Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am familiar with Windows Dir(oPath,"*.JPG) but am having difficulty with Excel 2004 for Mac.

    Excel 2004 does not use wildcards for Mac but utilizes the MacId of the file.

    Here is an example of the code I am using. My challenge is that not all JPG files are being listed and I am not sure why.

    strFileName = Dir(oPath, MacID("JPEG"))

    While strFileName <> ""
    ActiveSheet.Range("A2").Offset(i, 0).Value = strFileName

    i = i + 1

    strFileName = (Dir)

    Wend


    Thanks for taking a look,
    John

  2. #2
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts
    Hmmm, since I don't use a Mac we are going to have to hope an Excel using Mac user stops by.
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  3. #3
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts
    I've tested it, and have the same problem (Snow Leopard and XL2004).
    I can't see any reason for it, since the photos I was looking at were all taken on the same day with the same camera, so I can only suggest not using the second argument with Dir and just checking the extension instead.
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

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