Batch processing (xlsx to xlsb) in Excel 2010

Page 2 of 3 FirstFirst 123 LastLast

  1. Posts : 640
    Windows 7 Ultimate x64
       #11

    Sorry.
    My folder topology looks like this:
    main folder -> containing 44 folders -> each of them containing 1-3 specific folders -> where each of those specific folders contain 1 specific folder -> which contains the xlsx-files (about 10-30 files) which need to be converted into xlsb-files.
    So the 44 subfolders contain around 1800 xlsx files?
    Is the "1 specific folder" in the subfolder named the same?
    Is that 10-30 files in each "1 specific folder" or all up?
    Do the files that need converting have anything in common. eg tag, dates?
    Can you do a search in Explorer and return those specfic files or sort returned files so there grouped?
      My Computer


  2. Posts : 18
    Windows 7 Ultimate x64
    Thread Starter
       #12

    Yes, the "1 specific folder" you bolded is named exactly the same.
    And yes, this "1 specific folder" contains 10-30 files.
    Well, the files have something in common, but there are files named the same in other folders, which I don't want to be converted.
    So no, I can't (at least I can't think of a way how I could) search for the specific files only.
      My Computer


  3. Posts : 640
    Windows 7 Ultimate x64
       #13

    If there's only 10-30 files in one folder that need converting it wil probably be easier just to copy the paths one by one.

    Otherwise does the "1 specific folder" named exactly the same exist in multiple subfolders and contain only the files to be converted?

    Draw me a better picture, eg.
    Main Folder
    -Sub1
    ---FolderW
    -----Files (don't convert)
    ---FolderX
    -----Files (don't convert)
    ---Specific Folder
    -----Files (All Convert)

    -Sub2
    ---FolderY
    -----Files (don't convert)
    ---FolderZ
    -----Files (don't convert)
    ---Specific Folder
    -----Files (Some Convert)
      My Computer


  4. Posts : 18
    Windows 7 Ultimate x64
    Thread Starter
       #14

    I don't think so. Like I said, altogether there are like 1800 xlsx files. The "1 specific folder" contains 10-30 files. So I have about 90 of those "1 specific folders". Therefore copying the paths one-by-one is too time consuming.

    Yes Exactly. The "1 specific folder" has the same name in every of the subfolders. This "1 specific folder" contains only files which need to be converted (10-30 files).
    So if it's possible to search for all of the folders named like the "1 specific folder" and to convert all the xlsx files it has in it, that should do the trick.

    *edit*
    just saw your edit after posting. I'm going to prepare a better picture for you. just one sec...
      My Computer


  5. Posts : 640
    Windows 7 Ultimate x64
       #15

    First try this,
    Code:
    For /r "C:\Main Folder" %i in ("Specific Folder\*.xlsx") do echo %i >> FilePaths.txt
      My Computer


  6. Posts : 18
    Windows 7 Ultimate x64
    Thread Starter
       #16

    ^works, BUT returns the path of each xlsx file. What I need for the macro strollin posted, is the path of the "specific folders" only.
      My Computer


  7. Posts : 640
    Windows 7 Ultimate x64
       #17

    My mistake again.
    Just open the main folder in Explorer and search for "Specific Folder".
    Select all folders, hold shift and right click.
    Click Copy as Path
    Paste into notepad

    Edit > Replace
    Find: "
    Leave Replace blank and Replace all

    Edit > Replace
    Find: Specific Folder
    Replace: Specific Folder\
    Replace all

    I tested the macro and it won't work if the path contains the quotes.

    Edit: Just paste straight into Excel and do the second Replace
      My Computer


  8. Posts : 18
    Windows 7 Ultimate x64
    Thread Starter
       #18

    ah right, I could have thought of that myself. :\
    Thanks a lot!
    Rep added to both of you, Duzzy and strollin!

    (I'll run the macro while I'm away, I'll report back if everything went fine)
      My Computer


  9. Posts : 3,371
    W10 Pro desktop, W11 laptop, W11 Pro tablet (all 64-bit)
       #19

    I don't think anyone can provide you with a 1-click solution, whatever method you use will require you to put in some manual effort.
      My Computer


  10. Posts : 3,371
    W10 Pro desktop, W11 laptop, W11 Pro tablet (all 64-bit)
       #20

    Duzzy said:
    My mistake again.
    Just open the main folder in Explorer and search for "Specific Folder".
    Select all folders, hold shift and right click.
    Click Copy as Path
    Paste into notepad

    Edit > Replace
    Find: "
    Leave Replace blank and Replace all

    Edit > Replace
    Find: Specific Folder
    Replace: Specific Folder\
    Replace all

    I tested the macro and it won't work if the path contains the quotes.

    Edit: Just paste straight into Excel and do the second Replace
    The macro could be modified to add the backslash which would eliminate the need for the second Replace. Replace this line:

    Code:
    strPath = ThisWorkbook.Worksheets(1).Cells(i, 1).Value
    with this:

    Code:
    strPath = ThisWorkbook.Worksheets(1).Cells(i, 1).Value & "\"
    Either way, all the paths in the list need to be consistent.
      My Computer


 
Page 2 of 3 FirstFirst 123 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 17:49.
Find Us