Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9210215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:01:09+00:00 2026-06-18T01:01:09+00:00

I am using xlsread on a 1.4 MB excel file. I started to notice

  • 0

I am using xlsread on a 1.4 MB excel file. I started to notice some odd behaviors after running my m code a few times.

  • I cannot open excel files using double click (can only use matlab)
  • 2 LARGE (30Mb) EXCEL.EXE*32 files open per m-code run before a clear (I call the function 2 times)

I fell like matlab is not cleaning up its file handles. My updated code using corner to corner reads reads data using the following two lines

prs = xlsread(file, 'data2','A2:C550');
elm = xlsread(file, 'element','A2:C65536');

Task manager shows two large EXCEL.EXE*32 files after both functions are called. I have tried to

clear
clear all
close all
fclose('all')
fclose(0); fclose(1); fclose(2)

etc. I close matlab and they are still open.

Did some more snooping after trying to restart with no results.

xlsread populates what appears to be a server with excel to read information using

Excel = actxserver('excel.application');

The cleanup looks like it is supposed to happen here

cleanUp = onCleanup(@()xlsCleanup(Excel, file));        
[numericData, textData, rawData, customOutput] = xlsreadCOM(file, sheet, range, Excel, customFun);

followed by a

clear cleanUp; 

later in the program. Research suggests this is supposed to run a clean up function called xlsCleanup. Copied the file here for reference.

function xlsCleanup(Excel, filePath)
    try %#ok<TRYNC> - Suppress any exception
        %Turn off dialog boxes as we close the file and quit Excel.
        Excel.DisplayAlerts = 0; 
        %Explicitly close the file just in case.  The Excel API expects
        %just the filename and not the path.  This is safe because Excel
        %also does not allow opening two files with the same name in
        %different folders at the same time.
        [~, n, e] = fileparts(filePath);
        fileName = [n e];
        Excel.Workbooks.Item(fileName).Close(false);
    end
    Excel.Quit;
end

Firstly, its anoying that it catches exceptions without an alert. I checked, but the code wasn’t throwing exceptions. It appears that the line

Excel.Workbooks.Item(fileName).Close(false);

is just not ending the process. I don’t know what could be causing this beyond this function (can’t step in anymore) and there is no mention on the web about issues with it. Please help me explain this behavior. Taking up all of my memory

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:01:10+00:00Added an answer on June 18, 2026 at 1:01 am

    Still no solution to the matlab issue. This is what I am using to close the million processes that remain open after running my file a few times.

    In Cygwin:

    ps -W | grep EXCEL | cut -c -9 | xargs /bin/kill -f
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using xlsread in MATLAB to read in sheets from an excel file.
Using JNotify in project and it fulfill my all requirements, but some times it
Using the Exiv2 library to write some exif tags to an image i'm running
Using ASIHTTPRequest, I downloaded a zip file containing a folder with several audio files.
Using this is very helpful when trying to generate html code in c#. var
Using ember 1.0.0-pre3 I have a little app that has this code: window.App =
Using a form I am adding some basic fields to my table. I also
Using this code, the following execution yields strange results: C 100 R W The
Using Visual Studio / C#, I've been debugging some nunit tests recently, and am
using this code: Java Server side: ... out = new PrintWriter(this.client.getOutputStream(), true); ... public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.