Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

Export data to excel through X++

$
0
0

Hi All,

I am trying to export data to excel from AX through X++.

I have written a piece of code to freeze the top row of the excel while exporting using freezepanes method. Please find the code below:

xlsApplication = SysExcelApplication::construct();

com = new COM("Excel.Application");

fileName = "C:\\Test.xlsx";

xlsApplication.visible(true);

 comWindow = com.activeWindow();

 com.freezePanes(true);

After writing the above code,the following error popped up:

Method 'freezePanes' is not supported by the Automation interface of the COM object of class 'Excel.Application'.

I checked the following options but unfortunately unable to export data:

1) I am using excel 2013 and confirmed that it is compatible with AX2012 R2 CU7

2) I have killed all the excel sessions open and ran the code again.

3) Verified that office Ad-ins have been installed.

It will be very helpful if someone can help me on this issue.

regards,

Padmaja


Viewing all articles
Browse latest Browse all 175888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>