1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
'Begin Description
'This script adjusts the width of row labels and column labels so that the labels fit on one line -- they don't wrap.
'Requirements: The pivot table on which the script will be run should be selected.
'End Description

Option Explicit

Sub Main

	'Declare SPSS object variables
	Dim objPivotTableMain As PivotTable
	Dim objItemMain As ISpssItem

	Dim bolFoundOutputDoc As Boolean
	Dim bolPivotSelected As Boolean
	
	'Call GetFirstSelectedPivot to get the selected pivot table 
	'GetFirstSelectedPivot is a global procedure in Global.sbs(the default Global Procedure file)
	Call GetFirstSelectedPivot(objPivotTableMain, objItemMain, bolFoundOutputDoc, bolPivotSelected)

	If (bolFoundOutputDoc = False) Or (bolPivotSelected = False) Then
		'either there wasn't an output doc or a pivot table wasn't selected
		Exit Sub
	End If
	
	objPivotTableMain.ClearSelection
	
	Call SetPivotTableColumnLabelsToNoWrap (objPivotTableMain)
	Call SetPivotTableRowLabelsToNoWrap (objPivotTableMain)

	
	' Deactivate the pivot table and exit
	objItemMain.Deactivate  
	
End Sub