Topic
  • 1 reply
  • Latest Post - ‏2012-11-16T13:37:41Z by SystemAdmin
SystemAdmin
SystemAdmin
445 Posts

Pinned topic exporting to excel

‏2012-11-16T04:19:49Z |
Hi,

I'm looking for a spss script that takes individual tables from output viewer and exports to a new sheet everytime, in the same excel file.

I used to have one that worked in version 12 or 13, but have since mislaid it,

thanks for any help,

rob
  • SystemAdmin
    SystemAdmin
    445 Posts

    Re: exporting to excel

    ‏2012-11-16T13:37:41Z  
    There are two possible solutions for this. The SPSSINC MODIFY OUTPUT extension command includes a plugin function that will export the specified items to Excel. If you have the Python Essentials installed, you can see how to use this by looking at the comments in the file customoutputfunctions.py.

    Here is one example from that file:
    
    * Export all the custom tables in the Viewer to separate sheets named table1, table2, ... SPSSINC MODIFY OUTPUT TABLES /IF SUBTYPE=
    "'Custom Table'" PROCESS=ALL /CUSTOM FUNCTION=
    "customoutputfunctions.excelexport(file='c:/temp/extest.xls', sheet=
    'table#',action=
    'CreateWorksheet')
    ".
    


    Another but less flexible solution is the ExportTablesToExcelFiles package in the Utilities Collection on the SPSS Community site.

    HTH,
    Jon Peck