MATLAB: How to fix java.io.Fi​leNotFound​Exception errors for .tmp files occurring while writing to excel files

excel write xlswrite java error

Hi,
I'm receiving the following error when executing scripts that involve writing to excel files:
FileSystemView.getShellFolder: f=C:\Matlab execution\67D0ECB0.tmp java.io.FileNotFoundException: File C:\Matlab execution\67D0ECB0.tmp not found at sun.awt.shell.Win32ShellFolderManager2.createShellFolder(Unknown Source) at sun.awt.shell.Win32ShellFolderManager2.createShellFolder(Unknown Source) at sun.awt.shell.ShellFolder.getShellFolder(Unknown Source) at javax.swing.filechooser.FileSystemView.getShellFolder(Unknown Source) at javax.swing.filechooser.FileSystemView.getSystemIcon(Unknown Source) at com.mathworks.jmi.MLFileIconUtils.getNativeFileIcon(MLFileIconUtils.java:242) at com.mathworks.jmi.MLFileIconUtils.getFileIcon(MLFileIconUtils.java:102) at com.mathworks.mlwidgets.explorer.extensions.basic.DefaultFileInfoProvider$1.run(DefaultFileInfoProvider.java:64) at com.mathworks.mlwidgets.explorer.model.FileDecorationModel$DeferHandler.run(FileDecorationModel.java:390) at com.mathworks.mlwidgets.explorer.model.FileDecorationModel$2.get(FileDecorationModel.java:275) at com.mathworks.mlwidgets.explorer.util.UiFileSystemUtils.getDecorationSynchronously(UiFileSystemUtils.java:125) at com.mathworks.mlwidgets.explorer.util.UiFileSystemUtils.getDecorationSynchronously(UiFileSystemUtils.java:98) at com.mathworks.mlwidgets.explorer.model.table.FileSystemExpansionProvider.getDecoration(FileSystemExpansionProvider.java:124) at com.mathworks.mlwidgets.explorer.model.table.FileSystemExpansionProvider.getDecoration(FileSystemExpansionProvider.java:129) at com.mathworks.mlwidgets.explorer.model.table.IconColumn$1.convert(IconColumn.java:38) at com.mathworks.mlwidgets.explorer.model.table.IconColumn$1.convert(IconColumn.java:35) at com.mathworks.widgets.grouptable.GroupingTableColumn.getValue(GroupingTableColumn.java:141) at com.mathworks.widgets.grouptable.GroupingTableRow.getValueAt(GroupingTableRow.java:474) at com.jidesoft.grid.TreeTableModel.getValueAt(Unknown Source) at javax.swing.JTable.getValueAt(Unknown Source) at com.jidesoft.grid.CellSpanTable.getValueAt(Unknown Source) at com.jidesoft.grid.JideTable.prepareRenderer(Unknown Source) at com.jidesoft.grid.CellStyleTable.prepareRenderer(Unknown Source) at com.mathworks.widgets.grouptable.GroupingTableUIDelegate.paintCell(GroupingTableUIDelegate.java:66) at com.mathworks.widgets.grouptable.GroupingTableUIDelegate.paintSpanCells(GroupingTableUIDelegate.java:373) at com.mathworks.widgets.grouptable.GroupingTableUIDelegate.paint(GroupingTableUIDelegate.java:141) at com.jidesoft.plaf.basic.BasicCellSpanTableUI.paint(Unknown Source) at javax.swing.plaf.ComponentUI.update(Unknown Source) at javax.swing.JComponent.paintComponent(Unknown Source) at com.jidesoft.grid.CellStyleTable.paintComponent(Unknown Source) at com.mathworks.widgets.grouptable.GroupingTable.paintComponent(GroupingTable.java:267) at javax.swing.JComponent.paint(Unknown Source) at javax.swing.JComponent.paintToOffscreen(Unknown Source) at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source) at javax.swing.RepaintManager$PaintManager.paint(Unknown Source) at javax.swing.RepaintManager.paint(Unknown Source) at javax.swing.JComponent._paintImmediately(Unknown Source) at javax.swing.JComponent.paintImmediately(Unknown Source) at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source) at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source) at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source) at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)
I would really appreciate how to fix/stop this!
The error doesn't occur every time, but it does roughly 50% of the time the code is run.
Thanks, Nish

Best Answer

Hi Nish,
I was able to fix a similar problem by using ActiveX instead of xlswrite. I posted the answer to my own question here.
Hope this helps,
Sofie
Related Question