Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Open All Files in Folder: How To

· 5 min read · Home Tech

In this article
  1. What Does "Open All Files" Mean in Excel?
  2. Opening Multiple Files as Separate Windows
  3. Combining All Files into One Workbook with Power Query
  4. Using VBA to Open or Combine Files
  5. Common Problems and Pitfalls
  6. Alternatives to Opening All Files
  7. Frequently Asked Questions

Yes, you can open all files in a folder at once in Excel, but the method depends on what you mean by "open." If you want to open every Excel workbook in a folder as separate windows, there is no single built-in button, but you can select multiple files in the Open dialog. If you want to combine all files into one workbook, you can use Power Query or VBA. This article covers both approaches, plus the limitations and alternatives.

What Does "Open All Files" Mean in Excel?

The phrase "open all files in folder" usually means one of two things:

  • Open each file as a separate Excel window so you can view or edit them individually.
  • Combine all files into a single workbook (e.g., all data on one sheet or separate sheets) for analysis.

Excel does not have a dedicated "Open All" command, but you can achieve both outcomes with built-in features or a small amount of VBA code.

Opening Multiple Files as Separate Windows

If you just need to have several workbooks open at once, the simplest method is:

  1. In Excel, go to File > Open > Browse.
  2. Navigate to the folder containing your files.
  3. Hold Ctrl and click each file you want to open (or press Ctrl+A to select all).
  4. Click Open.

Excel will open each selected file in its own window. This works for .xlsx, .xls, .xlsm, and .csv files. A common misconception is that this also works from File Explorer—if you select multiple files and press Enter, Windows will try to open them all, but Excel may only open the first one depending on your version and settings. The Open dialog method is more reliable.

Combining All Files into One Workbook with Power Query

If your goal is to consolidate data from multiple files (e.g., monthly sales reports) into a single table, Power Query is the modern, no-code solution. Here's how:

  1. In Excel, go to Data > Get Data > From File > From Folder.
  2. Browse to the folder and click OK.
  3. In the dialog, click Combine & Load. If your files have different structures, choose Combine & Transform Data to edit the query first.
  4. Power Query will create a preview. Click Close & Load to put the combined data on a new worksheet.

This method works best when all files have the same columns. If they don't, you may need to clean the data in the Power Query editor before loading. Power Query is available in Excel 2016 and later, and in Microsoft 365.

Using VBA to Open or Combine Files

For more control, you can use a simple VBA macro. For example, to open every .xlsx file in a folder:

  1. Press Alt+F11 to open the VBA editor.
  2. Insert a new module and paste this code:
Sub OpenAllFiles()
    Dim FolderPath As String
    Dim FileName As String
    FolderPath = "C:\YourFolder\"  ' change this
    FileName = Dir(FolderPath & "*.xlsx")
    Do While FileName <> ""
        Workbooks.Open FolderPath & FileName
        FileName = Dir
    Loop
End Sub
  1. Press F5 to run the macro.

This opens each file in a new window. To combine data instead, you can modify the code to copy ranges from each file into a master workbook. VBA is powerful but requires enabling macros (File > Options > Trust Center > Macro Settings). Be aware that macros can be a security risk, so only run code from sources you trust.

Common Problems and Pitfalls

  • File format issues: Opening .xls files may trigger a compatibility warning. Convert them to .xlsx if possible.
  • Large number of files: Opening 100+ files at once can slow down Excel or cause memory errors. Consider combining them instead.
  • Power Query errors: If files have different headers, Power Query may fail. Use "Combine & Transform" to manually map columns.
  • VBA file path: The path must end with a backslash. Use double backslashes in the code as shown.
  • Hidden files: The Dir function may include hidden files. You can filter with attributes if needed.

Alternatives to Opening All Files

If you don't need to open every file, consider these alternatives:

  • Excel's "Recent Files" list to quickly access files you've used before.
  • Windows File Explorer to preview file contents without opening them (enable the preview pane).
  • Power Query to connect to a folder and refresh data without opening the source files.
  • Third-party tools like "Merge Excel Files" add-ins, but they may not be free or secure.

Frequently Asked Questions

Why doesn't Excel open all files when I select them in File Explorer?

Windows may only pass the first file to Excel due to how the application handles multiple file arguments. Using Excel's own Open dialog (File > Open > Browse) with Ctrl+click is the reliable way to open several at once.

Can I open all .csv files in a folder at once?

Yes, the same method works for .csv files. However, Excel may not parse them correctly if they contain special characters or different delimiters. Use the Text Import Wizard (Data > From Text/CSV) for better control.

Is there a way to combine files without Power Query?

Yes, you can use VBA to copy data from each file, or manually copy and paste. Power Query is the most user-friendly for repeatable tasks because it can refresh automatically.

Will opening many files slow down my computer?

Yes, each open workbook consumes memory. If you open more than 20-30 large files, you may experience lag or crashes. Combining files into one workbook is more efficient.

Can I open all files in a subfolder as well?

Power Query's "From Folder" can include subfolders if you enable the option in the preview. VBA's Dir function only scans the specified folder; you'd need to use FileSystemObject to recurse into subfolders.