Monk89 has asked for the wisdom of the Perl Monks concerning the following question:

when using #### Save As .prn file $Book1->SaveAs({Filename =>'C:\xxxx\xxxx\xxx.prn', FileFormat => xlTextPrinter}); For xlsm file what FileFormat we need to specify ? Thanks & regards, Monk89

Replies are listed 'Best First'.
Re: Save as .xlsm file
by Anonymous Monk on Jun 28, 2009 at 14:38 UTC
      #### Save As .prn file $Book1->SaveAs({Filename =>'C:\xxxx\xxxx\xxx.prn', FileFormat => xlTextPrinter}); for .xlsm what Fileformat we need to specify ?
Re: Save as .xlsm file
by CountZero (Bishop) on Jun 28, 2009 at 22:05 UTC
    Unless your Excel 2003 knows how to save the spreadsheet data in .xslm format you must have Excel 2007 installed.

    I had a quick check on CPAN and it seems there is no module available that allows you to save in .xslm format.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re: Save as .xlsm file
by Anonymous Monk on Jun 28, 2009 at 14:36 UTC
Re: Save as .xlsm file
by Sinistral (Monsignor) on Jun 30, 2009 at 14:31 UTC

    Although the advice to search on MSDN is a good one, sometimes MS does its best to obfuscate information. As a service to all, I rummaged about and managed to find the definition of the XlFileformat Enumeration (aka, the options you would use in scripting via VBA or Win32::OLE to save):

    http://msdn.microsoft.com/en-us/library/bb241279.aspx

    I think the one you want for xlsm is xlOpenXMLWorkbookMacroEnabled

      Thanks to all , it worked when i specifed FileFormat => 52. Ya string "xlOpenXMLWorkbookMacroEnabled" instead of 52 should also work. And yes we require MS 2007 installed.