Share via

How can I export SharePoint Online search results (with file paths) to Excel without the .iqy re-query causing “Out of memory”?

Jennifer 0 Reputation points
2025-12-15T22:09:52.0033333+00:00

Context / Scenario: In SharePoint Online, I run a keyword search inside a large document library. I need to export the visible search results (as shown in the browser) to Excel—including file name, file path/URL, and other columns in the current view. I do not have access to every subfolder in the library, but I can see search results that I’m permitted to view. This function used to work but it is unclear what has changed.

One .iqy file that was used create a .xlsx file in August 2025 loaded 171,308 rows of data no problem using this "Export to Excel" feature, but now this feature does not work even with a search query that returns 1 singular result. [done for testing purposes]

Recreate by:

  1. Go to the document library. ("https://[business].sharepoint.com/sites/#####/est1/Forms/AllItems.aspx")
  2. Use the search box (example keyword: "Testing 123" results load between 200-175,000 files).
  3. Click Export to Excel on the results page.
  4. Open the downloaded file (it’s an .iqy internet query file) in Excel.

What happens

  • Excel shows “Reading Data” for a very long time.
  • Eventually (15-45 minutes) returns “Out of memory.” and Excel closes the newly created workbook without saving (tested on a 32GB RAM device, cleared cache, expanded limits).
  • It appears the .iqy tries to re-run the query against the entire library within excel, rather than exporting the filtered search results currently displayed in SharePoint.
  • Even "Site Owners - full control" cannot find a workaround.
  • No ability to use Get Data from Web, Organizational Account, or copy/paste with hyperlinks or file paths.
  • Even IT cannot override permissions or export in any other format

Example URL (sanitized pattern & my concrete example) Pattern:

https://<tenant>.sharepoint.com/sites/<site>/<library>/Forms/AllItems.aspx?id=%2Fsites%2F<site>%2F<library>&newTargetListUrl=%2Fsites%2F<site>%2F<library>&viewpath=%2Fsites%2F<site>%2F<library>%2FForms%2FAllItems.aspx&view=<viewId>&q="%3Ckeyword%3E"

Actual example:

https://[business].sharepoint.com/sites/#####/est1/Forms/AllItems.aspx?id=%2Fsites%2F#####%2Fest1&newTargetListUrl=%2Fsites%2F#####%2Fest1&viewpath=%2Fsites%2F#####%2Fest1%2FForms%2FAllItems%2Easpx&view=7&q=%22Testing%20123%22 

What I expect

  • Export to Excel should export exactly the search results visible in the browser (static data), including:
    • Name
      • Path / URL
        • Any other columns present in the current view
  • It should not re-query or re-index the whole library or require access to every subfolder to make a list of the documents that I have access to, and are already displayed in the SharePoint in my browser.

Attempts / Workarounds tried (unsuccessfully)

  • Copy/paste results from the page (doesn’t paste in Table format-requires excessive reformatting and does not include link/path/metadata, inconsistent with large result sets, randomly seems to skips files).
  • Excel Binary and other file extensions: Whether on-line or in-app this data will not load in any known combination of file extensions (.xlsb, .xlsm, etc.) or application settings tried by our whole team (even I.T.).
  • Power Automate: “Get files (properties only)” with filters—cannot be done with any "Organizational account" that does not have complete privileges (that would be our Network Configuration Team... A.K.A. Microsoft).
  • REST API / PnP PowerShell / VBA: Cannot access, query, search, export (even JSON/CSV) or any scripting solution especially if it that requires macros (not possible and also not end-user friendly.)
  • Browser developer tools (Network tab) to capture search JSON and import via Excel Power Query— could work ostensibly... but Microsoft configures our DevOps and is the only one with access to our DevTools and/or can make changes to our CI/CD automation.

Impact

  • We cannot easily export search results for reporting, audit, or compliance.
  • The current behavior of Export to Excel (downloading .iqy that re-queries) is effectively unusable due to performance and memory failures (even if there is only a handful of results for each search query)

Questions for the community / Microsoft

**
**Other than the troubleshooting/patches/work-arounds described above:

  1. Is there a supported way to export the on-screen SharePoint Online search results (with file paths) directly to a static Excel/CSV (or any list with these results) without the .iqy re-query failure (without Macros— which is banned by our parent organization)?
  2. If the current .iqy behavior is by design, what is Microsoft’s recommended alternative for exporting search results (including paths) from the SharePoint Online UI?
  3. Has anyone configured a list/library view or search results page that allows a reliable export of the visible results (e.g., via Power Query, forced CSV export, or a custom search web part with export)?
  4. Any known settings, limits, or configurations to avoid the Excel “Out of memory” when using the .iqy approach (e.g., throttling, row limits, view configuration)?

Environment notes

  • SharePoint Online (Modern experience).
  • Excel Desktop (Microsoft 365).
  • User has partial permissions in the library (cannot access all subfolders).
  • Large document library.

Goal A supported, end-user-friendly way to export exactly the visible search results (including file paths) to Excel/CSV from SharePoint Online.

Moved from Microsoft 365 and Office | SharePoint | Development

Microsoft 365 and Office | SharePoint | For business | Other
0 comments No comments

2 answers

Sort by: Most helpful
  1. Sophie N 14,130 Reputation points Microsoft External Staff Moderator
    2025-12-16T02:58:57.4766667+00:00

    Dear @Jennifer,

    Thank you for posting your question in the Microsoft Q&A forum. The issue you're experiencing with the "Export to Excel" feature is a known challenge when working with large SharePoint document libraries. The core problem is that the .iqy file created by SharePoint is a live query, not a static data export. It attempts to load and process the entire library into Excel's memory before applying your search filters, which causes the "Out of memory" error. 

    To provide the most accurate guidance, please help us confirm two key details: 

    • Approximate total number of items in the est1 document library. 
    • Search Scope: When you use the library search box, are you typically selecting "Within this library" or "This site"/"Everything"? 

    This information is crucial for determining whether the following structural solution is viable. 

    Step 1: Restructure your data 

    If your searches are consistently scoped to "Within this library," the most effective long-term solution is to split your large document library into smaller, logical libraries. 

    • The .iqy file's behavior is inherent to the feature and cannot be changed to export only filtered results. By reducing the size of the source library, you eliminate the root cause of the memory overload. Exporting from a library with 20,000 items is fundamentally more reliable than from one with over 170,000 items. 
    • Action: Plan a migration to divide content by logical criteria such as year, department, or major project phase. This will improve performance for all operations (searching, syncing, loading views) and make the native "Export to Excel" feature functional again for these new, smaller libraries. 

    Step 2: Official support path for log analysis 

    If the library cannot be restructured and you need a definitive technical investigation into why this worked in August 2025 but fails now, the appropriate step is to open a service request through the Microsoft Unified Support portal. 

    • This provides backend engineers access to the necessary service logs for your tenant. They can analyze potential changes in query execution, throttling, or indexing that may have occurred since August, which are not visible from the user interface. 
    • When opening the ticket, include all details from your post and the information requested. 

    Please note that as a forum moderator, I don’t have access to backend tools or internal systems to investigate further, and certain settings or configurations are managed exclusively by your organization’s administrators, so I’m unable to check or make changes on that side. That said, I truly hope these suggestions help you move forward.  

    To proceed, please provide the requested details about your library's size and search scope. This will allow us to refine our recommendation and help you choose the most effective path forward. 


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".   

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Q&A Assist
    2025-12-15T22:10:20.4066667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Exporting search results from SharePoint Online to Excel can be challenging, especially with the issues you've described regarding the .iqy file causing memory errors. Unfortunately, the default behavior of the Export to Excel feature in SharePoint Online is to create an .iqy file that re-queries the entire library, which can lead to performance issues, especially in large libraries.

    Here are some suggestions and alternatives you might consider:

    1. Use Power Automate: While you mentioned difficulties with permissions, if you can work with someone who has the necessary access, consider setting up a Power Automate flow that retrieves the search results and exports them to an Excel file. This can bypass the .iqy limitations.
    2. Custom Search Results Page: If you have access to a developer or IT resources, creating a custom search results page using SharePoint Framework (SPFx) could allow for more control over the data displayed and how it is exported. This could include a button that exports the visible results to a static Excel or CSV file.
    3. Browser Developer Tools: As you noted, using the browser's developer tools to capture the JSON response from the search query could be a viable workaround. If you can get the JSON data, you could potentially transform it into a CSV format using a script or a tool that you have access to.
    4. Manual Copy-Paste: Although you mentioned issues with formatting, if the results are manageable, consider copying the search results directly from the browser and pasting them into Excel. This may require some manual formatting but could be a quick solution for smaller result sets.
    5. Check for Updates: Ensure that your SharePoint Online and Excel applications are up-to-date, as Microsoft frequently releases updates that may address performance issues or improve functionality.
    6. Contact Microsoft Support: Given the complexity of your situation, reaching out to Microsoft Support might provide additional insights or solutions tailored to your specific environment and permissions.

    Ultimately, the ability to export search results in a user-friendly manner may depend on the specific configurations and permissions set within your organization. If the .iqy behavior is by design, Microsoft may not have a direct alternative, but exploring custom solutions or leveraging existing tools within your organization could yield better results.


    References:

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.