+ Reply to Thread
Results 1 to 6 of 6

convert all xlsx in directory to text using vb

  1. #1
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    convert all xlsx in directory to text using vb

    I am trying to convert ~200 xlsx files in a directory to txt using vb. Is the below attempt close or what is the best way? Thank you .

    VB
    Please Login or Register  to view this content.
    or maybe:

    Please Login or Register  to view this content.
    Last edited by cmccabe; 12-28-2015 at 05:12 PM. Reason: added code

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: convert all xlsx in directory to text using vb

    That will get your txt file set up, but does nothing to the old xlsx file. If you do not want to keep the old xlsx file you would need to include a delete statement for it.

  3. #3
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    Re: convert all xlsx in directory to text using vb

    I am trying to convert each xlsx to a txt in the directory without deleting the original, but the syntax is not correct. Thank you .

    VB
    Please Login or Register  to view this content.
    The second VB runs but no output results.
    Last edited by cmccabe; 12-28-2015 at 05:49 PM. Reason: added details

  4. #4
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: convert all xlsx in directory to text using vb

    Something like this, maybe. Not sure about the directory, don't know where the original file is stored.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    Re: convert all xlsx in directory to text using vb

    The directory is correct. I think my problem will be I need to copy all workbooks in those .xlsx with the word
    analysis in them. Each xlsx file contains multiple workbooks, but the "analysis" workbook is the only one needed. Thank you very much .

  6. #6
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: convert all xlsx in directory to text using vb

    You know how to use the * wild card in the Dir function I hope. If analysis comes first "analysis*.xlsx", if it is embeded between "*analysis*.xlsx", if trailing "*analysis.xlsx" and hopefully it is consistent in all files.

    You're welcome,
    Regards, JLG

+ 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] Save all xls files in directory as xlsx
    By StartRunMSPaint in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-07-2014, 04:45 PM
  2. [SOLVED] convert xlsx to csv and save to file directory
    By shaz0503 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-27-2014, 07:19 PM
  3. how to convert .xlsx to .csv
    By Nehrav in forum Excel General
    Replies: 4
    Last Post: 11-04-2013, 07:24 AM
  4. [SOLVED] Won't convert xlsx to pdf well
    By sockerplaya37 in forum Excel General
    Replies: 2
    Last Post: 06-23-2013, 10:17 PM
  5. Convert xlsx to dat
    By swmmr1928 in forum Excel General
    Replies: 5
    Last Post: 03-13-2013, 05:30 PM
  6. Save all .xlsx files in a directory to .xls
    By paul00 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-24-2012, 08:05 PM
  7. Writing to all xlsx files in a directory
    By BretFelix in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2010, 06:34 PM

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