Pivot Table: Error when adding field to RowAxis

D

Debbie

I am learning OWC and am running into problems adding a fields in the
column or the row axis. The below code bombs on
oView.RowAxis.InsertFieldSet oView.FieldSets("[Sls Pref C]") with an
error message:
"Subscript out of range".
I can still pull fields into the various axes, however I want to
automatically fill them when the pivot table is pulled up.
I am using OWC for Office 2000. My data source is a cube, I built in
analysis services.
Any help would be greatly appreciated.

<HTML>
<HEAD>
</HEAD>
<BODY>
<object id="PivotTable1"
classid="CLSID:0002E520-0000-0000-C000-000000000046"></OBJECT>
<script language="VBScript">
<!--
Sub Window_Onload()

PivotTable1.ConnectionString = myconnectionstring
PivotTable1.DataMember = "INVOICE"


Dim oView
Set oView = PivotTable1.ActiveView
oView.RowAxis.InsertFieldSet oView.FieldSets("[Sls Pref C]")

End Sub
-->
</SCRIPT>
</BODY>
</HTML>
 
D

Dan Ricker

Try:

oView.RowAxis.InsertFieldSet oView.FieldSets("Sls Pref C")

no brackets

-----Original Message-----
I am learning OWC and am running into problems adding a fields in the
column or the row axis. The below code bombs on
oView.RowAxis.InsertFieldSet oView.FieldSets("[Sls Pref C]") with an
error message:
"Subscript out of range".
I can still pull fields into the various axes, however I want to
automatically fill them when the pivot table is pulled up.
I am using OWC for Office 2000. My data source is a cube, I built in
analysis services.
Any help would be greatly appreciated.

<HTML>
<HEAD>
</HEAD>
<BODY>
<object id="PivotTable1"
classid="CLSID:0002E520-0000-0000-C000-
000000000046"> said:
<script language="VBScript">
<!--
Sub Window_Onload()

PivotTable1.ConnectionString = myconnectionstring
PivotTable1.DataMember = "INVOICE"


Dim oView
Set oView = PivotTable1.ActiveView
oView.RowAxis.InsertFieldSet oView.FieldSets("[Sls Pref C]")

End Sub
-->
</SCRIPT>
</BODY>
</HTML>
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top