Share via


PivotTable.CreateCubeFile Method (Excel)

Creates a cube file from a PivotTable report connected to an Online Analytical Processing (OLAP) data source.

Syntax

.CreateCubeFile(File, Measures, Levels, Members, Properties)

A variable that represents a PivotTable object.

Parameters

Name

Required/Optional

Data Type

Description

File

필수

String

The name of the cube file to be created. It will overwrite the file if it already exists.

Measures

선택

Variant

An array of unique names of measures that are to be part of the slice.

Levels

선택

Variant

An array of strings. Each array item is a unique level name. It represents the lowest level of a hierarchy that is in the slice.

Members

선택

Variant

An array of string arrays. The elements correspond, in order, to the hierarchies represented in the Levels array. Each element is an array of string arrays that consists of the unique names of the top level members in the dimension that are to be included in the slice.

Properties

선택

Variant

False results in no member properties being included in the slice. The default value is True.

Return Value

String

Example

This example creates a cube file titled "CustomCubeFile" on drive C:\ with no member properties to be included in the slice. With the Measures, Levels, and Members arguments omitted from this example, the cube file will end up matching the view of the PivotTable report. This example assumes a PivotTable report connected to an OLAP data source exists on the active worksheet.

Sub UseCreateCubeFile() 
 
 ActiveSheet.PivotTables(1).CreateCubeFile _ 
 File:="C:\CustomCubeFile", Properties:=False 
 
End Sub

참고 항목

개념

PivotTable Object

PivotTable Object Members