When I load an EXCEL2010 (xslx) file with form controls or ActiveX controls (and responding macros) inside and save it as EXCEL_97_TO_2003 (xls) then the macros themselves are retained but the assignments to them vanish. Furthermore the controls themselves seem to be exported as drawings (first case) or pictures (OLE case) to XLS instead of the original control types.
Sampel code to reproduce it:
package com.rbinternational.test.aspose;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import org.junit.BeforeClass;
import org.junit.Test;
import aspose.AsposeLicenceLoader;
import com.aspose.cells.FileFormatType;
import com.aspose.cells.License;
import com.aspose.cells.Workbook;public class CommandButtonExcelFormatsTest
{
@BeforeClass
public static void licenseAspose()
{
License license = new License();
license.setLicense(AsposeLicenceLoader.getLicenceAsStream());
}@Test
public void testSaveOLEButtonIntoXLSFormat() throws Exception
{
Workbook workbook = new Workbook(new FileInputStream("xls/AsposeOLEControlTest.xlsm"));
FileOutputStream fos = new FileOutputStream("xls/AsposeOLEControlTest.xls");
workbook.save(fos, FileFormatType.EXCEL_97_TO_2003);
fos.flush();
fos.close();
}@Test
public void testSaveCommandButtonIntoXLSFormat() throws Exception
{
Workbook workbook = new Workbook(new FileInputStream("xls/AsposeControlTest.xlsm"));
FileOutputStream fos = new FileOutputStream("xls/AsposeControlTest.xls");
workbook.save(fos, FileFormatType.EXCEL_97_TO_2003);
fos.flush();
fos.close();
}
}
package com.rbinternational.test.aspose;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import org.junit.BeforeClass;
import org.junit.Test;
import aspose.AsposeLicenceLoader;
import com.aspose.cells.FileFormatType;
import com.aspose.cells.License;
import com.aspose.cells.Workbook;public class CommandButtonExcelFormatsTest
{
@BeforeClass
public static void licenseAspose()
{
License license = new License();
license.setLicense(AsposeLicenceLoader.getLicenceAsStream());
}@Test
public void testSaveOLEButtonIntoXLSFormat() throws Exception
{
Workbook workbook = new Workbook(new FileInputStream("xls/AsposeOLEControlTest.xlsm"));
FileOutputStream fos = new FileOutputStream("xls/AsposeOLEControlTest.xls");
workbook.save(fos, FileFormatType.EXCEL_97_TO_2003);
fos.flush();
fos.close();
}@Test
public void testSaveCommandButtonIntoXLSFormat() throws Exception
{
Workbook workbook = new Workbook(new FileInputStream("xls/AsposeControlTest.xlsm"));
FileOutputStream fos = new FileOutputStream("xls/AsposeControlTest.xls");
workbook.save(fos, FileFormatType.EXCEL_97_TO_2003);
fos.flush();
fos.close();
}
}
Does someone know a solution for that?
Regards Manfred