| Windows 7: Batch processing (xlsx to xlsb) in Excel 2010 |
12 Apr 2012
|
#1 | | |
Batch processing (xlsx to xlsb) in Excel 2010 Hello!
I need to convert xlsx-files to xlsb-files. I've found some tools on the internet, which are able to do that, but only if all the xlsx-files are in one folder.
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.
In short: there are about 1800 xlsx-files widespread amongst some folders and subfolders. And because there are so many folders and files, it would be a horror to do this manually.
The format of the folders is the same for all of them (just timestamps and numbering differs). | My System Specs |
| OS Windows 7 Ultimate x64 |
12 Apr 2012
|
#2 | | Windows 7 Ultimate x64 Service Pack 1 Doncaster, UK |
What tools have you found? I'm having trouble locating any. | My System Specs | | Computer type PC/Desktop System Manufacturer/Model Number Dwarf Dwf/11/2012 OS Windows 7 Ultimate x64 Service Pack 1 CPU Intel Core-i5-3570K 4-core @ 3.4GHz (Ivy Bridge) (OC 4.2GHz) Motherboard ASRock Z77 Extreme4-M Memory 4 x 4GB DDR3-1600 Corsair Vengeance CMZ8GX3M2A1600C9B (16GB) Graphics Card 2 x AMD Radeon HD7770 1GB CrossFired (OC 1100MHz/1250MHz) Sound Card Realtek High Definition on board solution (ALC 898) Monitor(s) Displays ViewSonic VA1912w Widescreen (VGA) Screen Resolution 1440x900 Keyboard Microsoft Comfort Curve Keyboard 3000 (USB) Mouse Microsoft Comfort Mouse 3000 for Business (USB) PSU XFX Pro Series 850W Semi-Modular Case Gigabyte IF233 Cooling 1 x 120mm Front Inlet 1 x 120mm Rear Exhaust Hard Drives OCZ Agility 3 SSD 120GB SATA III x2 (RAID 0)
Samsung HD501LJ 500GB SATA II x2
Hitachi HDS721010CLA332 1TB SATA II
Iomega 1.5TB Ext USB 2.0
WD 2.0TB Ext USB 3.0 Internet Speed NetGear DG834Gv3 ADSL Modem/Router (Ethernet) ~4.0 Mb/s (O2) Antivirus Avast! 8.0.1483 Browser IE 9 Other Info Optical Drive: HL-DT-ST BD-RE BH10LS30 SATA Bluray
Lexmark S305 Printer/Scanner/Copier (USB)
CTF-430 Tablet & Pen
WEI Score: 7.7/7.9/7.4/7.4/7.9
Asus Eee PC 1011PX Netbook (Windows 7 x86 Starter) OS Windows 7 Ultimate x64 |
12 Apr 2012
|
#4 | | Win 7 Ultimate (64-bit), Win 7 Pro (32-bit) N. Calif |

Quote: Originally Posted by noap ...
I've found some tools on the internet, which are able to do that, but only if all the xlsx-files are in one folder. ... That tool you linked to can handle multiple folders for the xls files but all of the converted files are placed in the same output folder. I didn't see any option to output the files to their original folder.
I assume you want the converted files to be outputted to their original folder?
It should be a trivial task for the developer to include the option to output the converted file to their original folder. You could try to contact the developer and ask if he would consider adding that option.
Here's one I found that can do command line processing: http://www.coolutils.com/Convert-XLS-XLSX With command line ability, you could write a batch file that changes to each folder that contains files you need to convert, do the conversion, then change to the next folder. It would take some time to write the batch file but it should do what you want. Oops! Just realized that this tool doesn't support converting to xlsb, only converts to xlxs so it won't do the job.
Last edited by strollin; 12 Apr 2012 at 10:12 AM..
| My System Specs | | System Manufacturer/Model Number Home Built, Dell Inspiron 1520 Laptop OS Win 7 Ultimate (64-bit), Win 7 Pro (32-bit) CPU 3.4Ghz 3770K i7, 2.4Ghz Core 2 Duo Motherboard Gigabyte Z77X-UD3H, Dell Memory 8G, 3G Graphics Card ATI Radeon HD 5770, Mobile Intel 965 Sound Card High Definition Audio (Built-in to mobo) Monitor(s) Displays Dell 2409W 24" Screen Resolution 1920x1080 Keyboard IBM Model M - used continuously since 1986 Mouse Microsoft PSU Antec Case Antec 100 Cooling CM 212+ Hard Drives 128G SSD OS; 1.5T & 2T Data on Desktop, 320G for laptop Internet Speed 1.5M down 1.2M up :-( Other Info Also have an Acer Aspire netbook, a home-built AMD Dual core (Minecraft server) and home-built Pent 4 all running Win 7. Also have various machines running XP, Win Server 2K, Win Server 2003, Linux and DOS. I think I have a problem... |
12 Apr 2012
|
#5 | | |
Yes exactly.
I'll try.
If someone else knows how to make this work, I'm willing to pay for it! | My System Specs | | OS Windows 7 Ultimate x64 |
12 Apr 2012
|
#6 | | Windows 7 Ultimate x64 Service Pack 1 Doncaster, UK |
I have located a program that will do what you want, with the ability to convert files in different folders, as you have stored them. Unfortunately, it is not free and is currently $159.95 according to the website. I'm not sure of your budget, but if you want to have a look the link is below. Note that unregistered versions will only convert the first 2 files found at a time. Conversion from excel xls Database Spreadsheets to pdf, images, XLS, HTML, XML quickly | My System Specs | | Computer type PC/Desktop System Manufacturer/Model Number Dwarf Dwf/11/2012 OS Windows 7 Ultimate x64 Service Pack 1 CPU Intel Core-i5-3570K 4-core @ 3.4GHz (Ivy Bridge) (OC 4.2GHz) Motherboard ASRock Z77 Extreme4-M Memory 4 x 4GB DDR3-1600 Corsair Vengeance CMZ8GX3M2A1600C9B (16GB) Graphics Card 2 x AMD Radeon HD7770 1GB CrossFired (OC 1100MHz/1250MHz) Sound Card Realtek High Definition on board solution (ALC 898) Monitor(s) Displays ViewSonic VA1912w Widescreen (VGA) Screen Resolution 1440x900 Keyboard Microsoft Comfort Curve Keyboard 3000 (USB) Mouse Microsoft Comfort Mouse 3000 for Business (USB) PSU XFX Pro Series 850W Semi-Modular Case Gigabyte IF233 Cooling 1 x 120mm Front Inlet 1 x 120mm Rear Exhaust Hard Drives OCZ Agility 3 SSD 120GB SATA III x2 (RAID 0)
Samsung HD501LJ 500GB SATA II x2
Hitachi HDS721010CLA332 1TB SATA II
Iomega 1.5TB Ext USB 2.0
WD 2.0TB Ext USB 3.0 Internet Speed NetGear DG834Gv3 ADSL Modem/Router (Ethernet) ~4.0 Mb/s (O2) Antivirus Avast! 8.0.1483 Browser IE 9 Other Info Optical Drive: HL-DT-ST BD-RE BH10LS30 SATA Bluray
Lexmark S305 Printer/Scanner/Copier (USB)
CTF-430 Tablet & Pen
WEI Score: 7.7/7.9/7.4/7.4/7.9
Asus Eee PC 1011PX Netbook (Windows 7 x86 Starter) |
12 Apr 2012
|
#7 | | Win 7 Ultimate (64-bit), Win 7 Pro (32-bit) N. Calif |
Here's a macro that should do what you want: Code: Sub ConvertToXlsb()
Dim strPath As String
Dim strFile, strConvFile As String
Dim wbk As Workbook
Dim i As Integer
Dim Dun As Boolean
i = 0
Dun = False
Do Until Dun
i = i + 1
If ThisWorkbook.Worksheets(1).Cells(i, 1) <> "" Then
' Path must end in trailing backslash
' IE C:\Test\
strPath = ThisWorkbook.Worksheets(1).Cells(i, 1).Value
strFile = Dir(strPath & "*.xlsx")
Do While strFile <> ""
If Right(strFile, 4) = "xlsx" Then
Set wbk = Workbooks.Open(Filename:=strPath & strFile)
strConvFile = Replace(strFile, "xlsx", "xlsb")
wbk.SaveAs Filename:=strPath & strConvFile, FileFormat:=xlExcel12
wbk.Close SaveChanges:=False
End If
strFile = Dir
Loop
Else
Dun = True
End If
Loop
End Sub If you put the list of folders in column A of a worksheet (note that the macro expects the folder spec to end in a backslash), it will loop thru each folder in the list and convert all .xls files within the folder to .xlsb. The original file will remain unchanged and the new file will be saved in the original folder.
Last edited by strollin; 12 Apr 2012 at 01:33 PM..
| My System Specs | | System Manufacturer/Model Number Home Built, Dell Inspiron 1520 Laptop OS Win 7 Ultimate (64-bit), Win 7 Pro (32-bit) CPU 3.4Ghz 3770K i7, 2.4Ghz Core 2 Duo Motherboard Gigabyte Z77X-UD3H, Dell Memory 8G, 3G Graphics Card ATI Radeon HD 5770, Mobile Intel 965 Sound Card High Definition Audio (Built-in to mobo) Monitor(s) Displays Dell 2409W 24" Screen Resolution 1920x1080 Keyboard IBM Model M - used continuously since 1986 Mouse Microsoft PSU Antec Case Antec 100 Cooling CM 212+ Hard Drives 128G SSD OS; 1.5T & 2T Data on Desktop, 320G for laptop Internet Speed 1.5M down 1.2M up :-( Other Info Also have an Acer Aspire netbook, a home-built AMD Dual core (Minecraft server) and home-built Pent 4 all running Win 7. Also have various machines running XP, Win Server 2K, Win Server 2003, Linux and DOS. I think I have a problem... |
13 Apr 2012
|
#8 | | |
wow, thanks a lot!
just one question if I got that right:
Do I have to enter every folder with the xlsx-files? Because there are approximately 100 folders. Copying every folderpath to excel worksheet can be a bit timeconsuming.
Last edited by noap; 13 Apr 2012 at 02:16 AM..
| My System Specs | | OS Windows 7 Ultimate x64 |
13 Apr 2012
|
#9 | | |
Open a cmd window and paste this Code: dir /b /on /s "C:\Folder"\*.xlsx > FilePaths.txt Quote: If you put the list of folders in column A of a worksheet (note that the macro expects the folder spec to end in a backslash), it will loop thru each folder in the list and convert all .xls files within the folder to .xlsb. Now open FilePaths.txt in notepad.
Select Edit > Replace.
Find = .xlsx
Replace = .xlsx\
Replace all
Select all and copy to Column A | My System Specs | | System Manufacturer/Model Number Self built OS Windows 7 Ultimate x64 CPU Intel Pentium Dual Core E5200 2.5GHz (3.77GHz OC) Motherboard Asus P5Q-E Memory Corsair 4GB DDR2 (4x1GB CM2X1024-6400C4) Graphics Card Palit GeForce GTS 250 (1024MB) Sound Card On Board (ADI AD2000B 8ch HD) Monitor(s) Displays Samsung 32in LCD TV Screen Resolution 1360x768 Keyboard Logitech MX5000 Laser (Combo) Mouse Logitech MX5000 Laser (Combo) PSU 550W Antec Neo HE 550 Case Antec P180 Cooling Xigmatex Red Scorpion CPU Cooler. 3x120mm Fans Hard Drives 2 x 1TB Samsung 103SJ (Raid0)
2 x External 500GB Samsung 502IJ (NexStar 3 HD Enclosures) Internet Speed ADSL2+ (avg 10 Mbps Down, 0.80 Mbps up) Other Info Gigabyte GN-WP01GS 54g Wireless Lan Card |
13 Apr 2012
|
#10 | | |
But this returns me every folder with *.xlsx-files in it. That's not what I want. I can't filter for the specific xlsx-files by searching for *2010.xlsx for example, because the file names are different every time (different timestamps). | My System Specs | | OS Windows 7 Ultimate x64 Batch processing (xlsx to xlsb) in Excel 2010 problems? All times are GMT -5. The time now is 02:45 PM. | |