Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i associate excel file type (xlsx) with iPhone application

Tags:

xcode4

ios5

uti

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

like image 541
Mahmoud Adam Avatar asked Feb 28 '12 15:02

Mahmoud Adam


People also ask

How can I open XLSX file in iOS?

Numbers for Mac You can either double-click the . xlsx file to open it in Pages (unless you have another default spreadsheets app) or click File > Browse from within the Numbers app to open and edit the file.

How do I associate Excel with XLSX?

Right clicking an . xlsx file, choosing Properties, and clicking the Change button. Going to Settings => Default Apps => Choose Apps by File Type.

How do I open an XLSX file in Apple?

Open a spreadsheet on a Mac: For a Numbers spreadsheet, double-click the spreadsheet name or thumbnail, or drag it to the Numbers icon in the Dock or in the Applications folder. For an Excel spreadsheet, drag it to the Numbers icon (double-clicking the file opens Excel if you have that app).


2 Answers

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>
like image 118
David Vít Avatar answered Sep 23 '22 15:09

David Vít


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

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

like image 33
André Kuhlmann Avatar answered Sep 22 '22 15:09

André Kuhlmann