• Post Reply Bookmark Topic Watch Topic
  • New Topic

Generate xlsx file based on xlsm template file  RSS feed

 
Jules Giulian
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have an .xlsm file (macro enabled) containing one macro inside it.
This macro is used to calculate the value for come cells.

I need to use this .xlsm file as a template, to generate an .xlsx file.

Could you please tell me how to achieve this?

I did a test, using Apache POI.
I generate the .xlsx file, but when I try to open the file, it gives me this error:
"Excel cannot open the file because the file format or file extension is not valid. Verify that the file has not been corrupted, and that the file extension matched the format of the file"

Here is the sample code:

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!