Office 2007 mime-type problem in KDE Plasma 5

Further to my 2015 post Office 2007 mime-type problem in KDE, another problem opening Excel .xlsm files in Office 2007 with WINE in Gentoo Linux Stable happened to me recently, this time in KDE Plasma 5.5.5. Whenever I clicked on an Excel macro-enabled spreadsheet file myspreadsheet.xlsm in Dolphin, a pop-up window titled ‘Choose Application – Dolphin’ would prompt me to ‘Select the program you want to use to open the file myspreadsheet.xlsm’. When I selected Microsoft Excel 2007 from the ‘Known Applications’ list and ticked ‘Remember application association for all files of type “Excel macro-enabled spreadsheet” (application/’, Excel would launch and load the spreadsheet. However, the next time I double-clicked the file, the pop-up window would prompt me again. So I tried setting the file association via ‘System Settings’ > ‘Applications’ > ‘File Associations’. Now, there are three entries under ‘Known Types’:, and x-wine-extension-xlsmhtml. However, there was no application listed in the box ‘Application Preference Order’ for, and, if I added Microsoft Excel 2007 to the list and clicked ‘Apply’, the new entry would disappear immediately.

Unlike the situation described in the above-mentioned post, the mime type for the .xlsm file appeared correct:

$ file myspreadsheet.xlsm
myspreadsheet.xlsm: Microsoft Excel 2007+
$ xdg-mime query filetype myspreadsheet.xlsm

The file /usr/share/mime/subclasses contains ‘macroEnabled‘ rather than ‘macroenabled‘:

$ grep macroenabled /usr/share/mime/subclasses
$ grep macroEnabled /usr/share/mime/subclasses
application/ application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
application/ application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
application/ application/vnd.openxmlformats-officedocument.presentationml.slideshow
application/ application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
application/ application/vnd.openxmlformats-officedocument.presentationml.presentation
application/ application/vnd.openxmlformats-officedocument.wordprocessingml.template
application/ application/vnd.openxmlformats-officedocument.spreadsheetml.template
application/ application/vnd.openxmlformats-officedocument.presentationml.template
application/ application/vnd.openxmlformats-officedocument.wordprocessingml.document
application/ application/vnd.openxmlformats-officedocument.presentationml.slide

but the work-around mentioned in my 2015 post (i.e. replacing ‘macroEnabled‘ with ‘macroenabled‘ in the file /usr/share/mime/subclasses) did not fix the latest problem: I was still prompted to choose an application every time I double-clicked on a .xlsm file. So I reverted to the original contents of /usr/share/mime/subclasses (i.e. back to ‘macroEnabled‘) and looked in the directory /usr/share/mime/application/ to see what it contained for Excel spreadsheets:

$ ls -1 /usr/share/mime/application/*

As there was no file for I decided to create one to see if that would solve the problem:

$ sudo cp /usr/share/mime/application/ /usr/share/mime/application/

It did! If I click on a .xlsm file now, Excel 2007 launches and opens the spreadsheet.

About Fitzcarraldo
A Linux user with an interest in all things technical.

One Response to Office 2007 mime-type problem in KDE Plasma 5

  1. Fitzcarraldo says:

    It looks like the problem with Plasma 5.5.5 not saving changes to File Associations is a bug, and I still experienced the problem after upgrading to Plasma 5.6.5 in Gentoo Linux. Anyway, I found a work-around in the Arch Linux Forums, as I explained in a post in the Gentoo Linux Forums: [Work-around] Plasma 5.6.5 does not save File Associations.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: