13

Hi
i have managed to open .xls files form mail app by adding document type to the project build and set the Types field to "com.microsoft.excel.xls" (see screen shot).
I want to do the same with xlsx files but can't do it. I tried to add "com.microsoft.excel.xlsx" but it didn't work

enter image description here

1
  • i'm stell stucked in this issue !!! Mar 8, 2012 at 11:39

3 Answers 3

18

I solved that by defining custom UTI as follows. Try to add these definitions into your info.plist. It works as expected.

<key>UTExportedTypeDeclarations</key>
<array>
    <dict>
        <key>UTTypeDescription</key>
        <string>XLSX input table document</string>
        <key>UTTypeTagSpecification</key>
        <dict>
            <key>public.filename-extension</key>
            <string>xlsx</string>
            <key>public.mime-type</key>
            <string>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</string>
        </dict>
        <key>UTTypeConformsTo</key>
        <array>
            <string>public.data</string>
        </array>
        <key>UTTypeIdentifier</key>
        <string>com.mydomain.myapplication.xlsx</string>
    </dict>
</array>

....

<key>CFBundleDocumentTypes</key>
<array>

    <dict>
        <key>CFBundleTypeName</key>
        <string>XLSX input table document</string>
        <key>LSHandlerRank</key>
        <string>Owner</string>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>com.mydomain.myapplication.xlsx</string>
        </array>
    </dict>
</array>
7

The identifier for XLSX files is org.openxmlformats.spreadsheetml.sheet

Checkout: https://escapetech.eu/manuals/qdrop/uti.html

1
  • I don't know why nobody vote for your answer, but it's works for me. Thanks! Oct 17, 2019 at 7:35
1

XSLX is already declared as org.openxmlformats.presentationml.presentation

2
  • 2
    That's PPTX, not XLSX.
    – Glorfindel
    Nov 21, 2016 at 11:42
  • And even if you do it like that, it doesn't work unless you add the custom UTI as in David's answer.
    – Glorfindel
    Nov 22, 2016 at 16:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.