Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Use Excel to Export clipboard function

(0) ShareShare
ReportReport
Posted on by 100

Hi

I am currently trying to replace the 'Export to Excel' function with a 'Export to OpenOffice' function. Pasting data of the clipboard to OpenOffice already works. I would like to use the code of the 'Export to Excel' function which copies the grid data to the clipboard (kernel side). So is there any way to call that function or a workaround?

It is also no option to modify SysGridExportToExcel because the Export to Excel Button which copies the grid data to the clipboard and then proceeds to call performPushAndFormatting is deactivated if there is no Excel installed (also kernel side).

*This post is locked for comments

  • Joey G Profile Picture
    Joey G 100 on at
    RE: Use Excel to Export clipboard function

    Hi Denis,

    I don't need to intercept the "export to Excel" command, because the kernel side logic should be executed. I'll then check in SysGridExportToExcel if OpenOffice is installed.

    Where would you search for the logic if Excel is installed or how should I intercept it?

  • Denis Macchinetti Profile Picture
    Denis Macchinetti 16,444 on at
    RE: Use Excel to Export clipboard function

    Hi Joey

    You can try to modify the SysSetupFormRun class, Task method and intercept the "export to Excel" command.

    I think you will be able to intercept also if Office isn't installed.

    Finally, call a new custom class that handle the Export Open office using COM objects

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,391 Super User 2024 Season 2 on at
    RE: Use Excel to Export clipboard function

    Hi Joey,

    You are right. I missed the AX 2009 tag. Here it is more part of the kernel compared to AX 2012. The toolbar is predefined.

    I don't have an answer to activate it without installing Excel.

    You can try to create a total new feature, but this will not be part of the toolbar.

  • Joey G Profile Picture
    Joey G 100 on at
    RE: Use Excel to Export clipboard function

    I am using AX 2009. When I click on the button nothing happens.

    This applies on any form.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,391 Super User 2024 Season 2 on at
    RE: Use Excel to Export clipboard function

    Hi Joey,

    I don't experience the problem where the Export to excel is deactivated. I have checked AX 2012 and AX 2012 R3. When I then click the button, it will ask me to find an app in the store...

    So I wonder why your button is not enabled. Please check it on e.g. the Main accounts list page. Please tell which form you used for testing this.

  • Joey G Profile Picture
    Joey G 100 on at
    RE: Use Excel to Export clipboard function

    Hi André,

    thanks for your help.

    You made some good point, but a problem is that the 'Export to Excel' is deactivated, if there is no Excel installed. I didn't find any way to change this.

    And another thing, 'isExcelInstalled' is never called (atleast not in accessible code) and changes didn't affect the outcome.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,391 Super User 2024 Season 2 on at
    RE: Use Excel to Export clipboard function

    Hi Joey,

    I wonder if anyone has the experience. In fact you have to deal with some logic that is build in the kernel.

    The command button action is a kernel option. Some logic have been made available to have users customize some formatting.

    You can try to change or add logic in several methods of the SysGridExportToExcel. There are methods called 'isExcelInstalled' and 'focusExcel'. You have to look at these as well.

    It might be an idea to add a parameter or user option with an enum which program to use: Excel or OpenOffice.

    Then based on this enum execute the standard logic or your new created OpenOffice interface. I don't know if you can call Open office using COM objects.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans