+ Reply to Thread
Results 1 to 2 of 2

I'm having trouble getting all files from a folder in excel for mac 2016

  1. #1
    Registered User
    Join Date
    06-13-2015
    Location
    NC, USA
    MS-Off Ver
    Office 2016 for Mac
    Posts
    29

    I'm having trouble getting all files from a folder in excel for mac 2016

    As the title says, I'm trying to return a list of all files in a specific folder. (I am trying to build something that will automatically generate a monthly statement for each of my clients.) I'm programming this to work on my MacBook. Since Excel 2016 for Mac doesn't have any VBA editing capability to speak of, I am using Windows Excel for programming and Mac Excel for running.

    So basically I am using MacScript("") to run a shell script which returns the items I want. (Many thanks to RondeBruin for his awesome website)

    OK so when I run the script, if I use MacScript("choose folder as string"), everything works properly as it should. However, if I set the desired destination in manually, it does not work. I output the strings of both methods to a cell and confirmed that the strings containing the pathnames are exactly the same.

    Here's where it gets weird: Let's say I have SpreadsheetA which uses MacScript("choose folder as string") to set the file path, and SpreadsheetB which uses VBA to set the filepath. I open SpreadsheetA and SpreadsheetB. I run the script in SpreadsheetB and it does not work. Now I run the script in SpreadsheetA and select the filepath and it works. If I run SpreadsheetB at this point, SpreadsheetB will work flawlessly until I close and restart Excel! This is what has me dumbfounded.

    Anyway, here is my code: (I've tried to trim out the extra stuff)


    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    06-13-2015
    Location
    NC, USA
    MS-Off Ver
    Office 2016 for Mac
    Posts
    29

    Re: I'm having trouble getting all files from a folder in excel for mac 2016

    Bump. Can anyone help with this??

    Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Excel VBA code for selecting a folder then search & open specified files in that folder
    By Excelrookie_1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-27-2021, 03:09 AM
  2. can't delete excel files in excel 2016
    By gagthegoose in forum Excel General
    Replies: 0
    Last Post: 06-21-2016, 03:40 PM
  3. Copy excel and text files from one folder to another folder...
    By annupojupradeep in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-26-2014, 06:34 AM
  4. copying data from excel files in a source folder to target folder
    By Javed07 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-22-2013, 04:27 PM
  5. Replies: 1
    Last Post: 01-24-2006, 11:35 AM
  6. Replies: 1
    Last Post: 01-24-2006, 11:00 AM
  7. Replies: 1
    Last Post: 01-24-2006, 12:25 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1