How do i copy sheet in excel with X++?

How do i copy sheet in excel with Ax 2009 X++?

you can use read and write of excel. direct copy is not possible according to me.

Unfortunately SysExcelWorksheet class doesn’t expose Worksheet.copy() method, therefore you would have to implement it by yourself.

It can be as simple as this:

public SysExcelWorksheet copy()
{
    COM newSheet = worksheet.copy(COMArgument::NoValue, this.comObject());

    return SysExcelWorksheet::construct(version, newSheet);
}

Hi Martin, Thanks for help… but That i could not . Can you please explain more ?

What’s the problem?

Hi Martin.
my fault . I solved the problem. Thank you for your help…