Can the Import Tool dialog box (when closing) be disabled

Is there a way to disable the prompt asking to confirm closing files in the Import Tool?
This is a new feature (probably from 2024). If I have multiple files open in the Import Tools (in different tabs) and I close the Tool (click the X) a dialog box appears for every single file asking to confirm.
I couldn't find any way to disable this, and when I have many files open this becomes very tedious.

4 Comments

Unfortunately, there doesn't seem to be a confirmation dialog setting for this prompt, no, and the uiimport function doesn't have any additional arguments to let you set its behavior [the tool simply executes uiimport('-file') ] that would let you customize its behavior as desired.
Submit this to Mathworks as an official support request/enhancement at <Product Support Page>; agreed, that would be very annoying in that mode of use.
Yes, this would be a great enhancement idea, something they will be supportive of when they get your request. Of course the author cannot think of everything, so your feedback is terribly useful.
Actually, since the tool function is
uiimport('-file')
and the uiimport itself doesn't have the dialog, it's the tab close dialog it would appear...
I submitted a request.
It is so annoying and wasn't there in older versions.

Sign in to comment.

 Accepted Answer

I heard back from MATLAB support.
While for now this dialog box cannot be disabled, they will consider adding that option in a future release.
In the meantime, they offered the following workaround (which I tried and it works):
  • Create a MATLAB script file, e.g. “closeImportTool.m”, in your current working folder.
  • Add the below MATLAB function code to this MATLAB script file and save the file.
function closeImportTool
wwmgr = matlab.internal.webwindowmanager.instance;
lst = wwmgr.windowList;
for idx = 1:length(lst)
w = lst(idx);
if strcmp(w.Title, "Import Tool")
disp("Closing...")
delete(w);
end
end
end
  • When you would like to close the Import Tool with multiple files open, run the following command in the Command Window:
>> closeImportTool
  • This closes the Import Tool without requiring you to click through the confirmation prompts.

More Answers (0)

Categories

Find more on Scripts in Help Center and File Exchange

Products

Release

R2025a

Asked:

Guy
on 8 Feb 2026

Answered:

Guy
on 10 Feb 2026

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!