Hi,
I have a problem running macro enabled Excel file under office 2007 (Windows Vista) with JExcel API(TeamDev). In ofice 2007, excel creates a separate file for macros with the extension .xlsm and JExcel API does not understand to open .xlsm file. Even if you try to open that you get error messages (ScreenShot attached, which does not understand .xlsm and gives the error for .xlsx) and also you get the error "COM Object method returns error code: 0x80004005; E_FAIL (Unspecified error)". If you try to run the .xlsx file you get the error saying the Macros are disabled and even if you go to security and enable macros, still you are not able to run it (Screen Shot attached). Any help running macros under Office 2007 with JExcel API will be appreciated.
-- ASHISH
Hi Ashish,
We have tested XLSM format parsing using MS Compartibility pack for Office 2003 and found that Workbook instance loads these files successfully. Tomorrow I will check this issue on Office 2007 and let you known the results.
Sincerely,
Igor Novikov
Hi Igor,
Here is the attached code for the same, I have created a macro enabled file in Excel 2003 named test.xls and Macro Enabled File Macro.xlsm. When I try to open the either file in Excel 2007 through the code, I get the Exceptions. Exception is :
java.lang.IllegalArgumentException: The specified file is not an Excel worbook.
at com.jniwrapper.win32.jexcel.ui.JWorkbook.openWorkbook(_JWorkbook.java:495_)
at com.abwg.client.jexcel.JExcelTest.main(_JExcelTest.java:17_)
Ashish
Hi Ashish,
We have found a problem reason. JWorkbook checks BIFF file CLSID before workbook loading. XLS and XLSX formats have equal CLSID but XLSM format CLSID is different.
We have fixed this issue and tomorrow will upload fixed build on our ftp. When fixed version will be ready for downloading we'll let you known.
Sincerely,
Igor Novikov
Hi Ashish,
Please find updated JExcel jars on following links:
ftp://ftp.teamdev.com/updates/jexcel-1.1.819.zip
ftp://ftp.teamdev.com/updates/jexcel-1.1-full.jar
Please try this solution and let us known the results.
Sincerely,
Igor Novikov
Hi Igor,
Thanks for the new build; the build is stable with Macros and works fine. But still I have a problem opening .xls files with Office 2007 and .xlsx files with Office 2003 (if not, May be compatibility Mode). I still get the same Exception when I try to open the .xls files with 2007 and vice versa. The sample code remains the same for testing purpose and I have inline comments for testing the same.
java.lang.IllegalArgumentException: The specified file is not an Excel workbook.
at com.jniwrapper.win32.jexcel.ui.JWorkbook.openWorkbook(_JWorkbook.java:546_)
at com.abwg.client.jexcel.JExcelTest.main(_JExcelTest.java:21_)
Thanks,
-- Ashish
Hi Ashish,
This issue has fixed for XLS file openin with Office 2007. But XLSX files cannot be opened by Office 2003 even with Compartibility pack, because XLSX document format is not recognized by Excel COM object. For this operation you need using file converting in background.
Tomorrow we plan uploading updated JExcel libraries on our ftp.
Sincerely,
Igor Novikov
Hi Ashish,
Updated JExcel libraries you can find on following link:
ftp://ftp.teamdev.com/updates/jexcel-1.1.820.zip
ftp://ftp.teamdev.com/updates/jexcel-1.1-full.jar
Sincerely,
Igor Novikov