Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Thu Jan 22, 2015 8:29 am

Hallo,
we work with Spire.XLS 6.8.1 . A customer want to use Excel Makro Worksheet (.xlsm) files.
Is there possible with Spire.XLS to load and write .xlsm files ?

In our code i use :
Workbook.LoadFromFile(test.xlsm) => Program terminate

Greetings Lars

lameb
 
Posts: 10
Joined: Mon Feb 20, 2012 2:39 pm

Thu Jan 22, 2015 8:51 am

Hello,

Thanks for your inquriy.
Please try the newest hotfix(Spire.XLS Pack Hotfix Version:7.6.21). If the issue still exists, please provide us your xlsm document.
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Fri Jan 23, 2015 9:47 am

Hello,

Have you tried the latest hotfix? Has your issue been resolved? Could you please give us some feedback if convenience?

If there are any questions, welcome to get it back to us.
Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Fri Jan 23, 2015 3:16 pm

Hello,
yes i tried it and LoadFromFile worked fine, then it will filled the Workbook with datas and then
"SaveToFile(fileName, ExcelVersion.Version2007)" .
I give the file a name like aaa.xlsm and the file are created.
Afterwards i try to open it and i became the error from Excel that the file has the wrong type or file extension.

lameb
 
Posts: 10
Joined: Mon Feb 20, 2012 2:39 pm

Mon Jan 26, 2015 2:11 am

Hello,

Thanks for your response. Please attach the document here for our testing.

Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Mon Jan 26, 2015 7:52 am

Hello,

i have zipped the .xlsm file for the upload.

Thanks for your help!!
Attachments
PaalSalden.zip
(19.94 KiB) Downloaded 285 times

lameb
 
Posts: 10
Joined: Mon Feb 20, 2012 2:39 pm

Mon Jan 26, 2015 9:35 am

Hello,

Thanks for the document. I have tested to load it and save it, then open, but there is no any errors, suppose that the issue might be caused by the data you added, could you please provide us a simple console application to demonstrate how to you add the data? It would be helpful to reproduce the issue and work out the solution for you ASAP.
Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Tue Jan 27, 2015 11:00 am

Thanks for your testing! It is not easy possible to send a sample console application, the
datas will with a monstrous construct filled in.
I have take out the button on the first sheet, because this can work later.
It exists only the macro without usage.
The same file without macro works fine.
Can it be, there is a problem when i generate a new Workbook and fill in it the datas?!

WorkBook = new Spire.Xls.Workbook();
WorkBook.Version = ExcelVersion.Version2007;
// fileName is the file with macro
WorkBook.LoadFromFile(fileName);
// add datas
WorkBook.SaveToFile("test.xlsm", ExcelVersion.Version2007);
// try to open in Excel with error - file has the wrong type or file extension.

Thanks for your help!

lameb
 
Posts: 10
Joined: Mon Feb 20, 2012 2:39 pm

Wed Jan 28, 2015 2:21 am

Hello,

Thanks for the information. But it is difficult to say what the problem is if we couldn't replicate it.
Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Return to Spire.XLS