Discussion:
Exporting tables to individual excel tab
(too old to reply)
LenP
2011-07-25 21:20:05 UTC
Permalink
Hi, I'm using v19 and would like to highlight a bunch of tables then
export them to an excel file to individual tabs with tab labels. Does
any have a piece of syntax or script?
Jon Peck
2011-07-25 22:26:09 UTC
Permalink
There is a Basic script that will do this named ExportTablesToExcelFiles. You can get it from the SPSS Community website (www.ibm.com/developerworks/spssdevcentral) in the Utilities collection.

It gives you the option of exporting all tables, all visible tables, or all selected tables. The output can be in a single sheet, in separate files, or each table can be in a separate sheet in the same file. The script has a dialog box interface for specifying all these options.

It requires that you have Excel installed, and it creates Excel files corresponding to the installed Excel version.

HTH,
Jon Peck
LenP
2011-07-26 14:09:13 UTC
Permalink
There is a Basic script that will do this named ExportTablesToExcelFiles.  You can get it from the SPSS Community website (www.ibm.com/developerworks/spssdevcentral) in the Utilities collection.
It gives you the option of exporting all tables, all visible tables, or all selected tables.  The output can be in a single sheet, in separate files, or each table can be in a separate sheet in the same file.  The script has a dialog box interface for specifying all these options.
It requires that you have Excel installed, and it creates Excel files corresponding to the installed Excel version.
HTH,
Jon Peck
Hi Jon,

Can you please point me the specific file?
LenP
2011-07-26 14:57:53 UTC
Permalink
There is a Basic script that will do this named ExportTablesToExcelFiles.  You can get it from the SPSS Community website (www.ibm.com/developerworks/spssdevcentral) in the Utilities collection.
It gives you the option of exporting all tables, all visible tables, or all selected tables.  The output can be in a single sheet, in separate files, or each table can be in a separate sheet in the same file.  The script has a dialog box interface for specifying all these options.
It requires that you have Excel installed, and it creates Excel files corresponding to the installed Excel version.
HTH,
Jon Peck
Hi Jon,

I did find the script - thanks. If was wanted to customize the tab
name, where is the script is it pulling from?
Jon Peck
2011-07-26 17:08:04 UTC
Permalink
The sheet name is a cleaned up version of the label for the object in the Viewer.
LenP
2011-07-27 16:40:08 UTC
Permalink
Post by Jon Peck
The sheet name is a cleaned up version of the label for the object in the Viewer.
Hi Jon, Sorry, I don't know what you mean. Can you paste in the place
and the change I need to make in order to have the script pull from
the table titles and make it the tab label?
Jon Peck
2011-07-28 13:11:32 UTC
Permalink
You can change the script behavior to pick up the title instead of the description, although these are often the same.

At line 92, this text occurs
itemlabel = cleanlabel(objOutputItem.Label)

You could change that to read
itemlabel = cleanlabel(objPivotTable.TitleText)

HTH,
Jon Peck
Jon Peck
2011-07-28 20:37:24 UTC
Permalink
Apparently my first try at responding disappeared into the ether.

The description attribute for a table is usually identical to the table title text, but you can change the function to use the title text instead.

At line 92 of the script, you will see
itemlabel = cleanlabel(objOutputItem.Label)

To use the title text instead, change it to read
itemlabel = cleanlabel(objPivotTable.TitleText)

HTH,
Jon Peck
s***@gmail.com
2019-07-05 09:21:13 UTC
Permalink
Post by LenP
Hi, I'm using v19 and would like to highlight a bunch of tables then
export them to an excel file to individual tabs with tab labels. Does
any have a piece of syntax or script?
Could you Please send me the script?
Bruce Weaver
2019-07-05 12:34:39 UTC
Permalink
Post by s***@gmail.com
Post by LenP
Hi, I'm using v19 and would like to highlight a bunch of tables then
export them to an excel file to individual tabs with tab labels. Does
any have a piece of syntax or script?
Could you Please send me the script?
SPSS is several new versions down the road since Jon posted that reply, and there are possibly newer, better ways of doing what you want to do. I suggest that you start a new topic/thread in the SPSSX-L discussion forum, which is far more active than this old usenet group. A convenient way to subscribe to SPSSX-L is via the Nabble archive here:

http://spssx-discussion.1045642.n5.nabble.com/

Click on the <more options> link at the top of the page.

In your new thread, please describe exactly what it is you are trying to do, and if possible provide some sample data. HTH.
Loading...