ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CreateCubeFile Method - RARELY Used - Need urgent help (https://www.excelbanter.com/excel-programming/354471-createcubefile-method-rarely-used-need-urgent-help.html)

SG

CreateCubeFile Method - RARELY Used - Need urgent help
 
Hi,

Please see if anyone can help me with this -

I have written to the following VBA code in excel to automate the
process of Offline Cubes creation :-

Sub UseCreateCubeFile()

Sheets("Sheet2").PivotTables("PivotTable1").Create CubeFile _
File:="C:\Documents and Settings\shegupta\Desktop\Sales.cub",
Measures:=Array("[Sales]"), Levels:=Array("[Product].[Company Name]"),
Properties:=False

End Sub

I am getting the error "Invalid Procedure call or argument".
I have checked extensively the HELP available on MSDN / excel help
files / and searched a lot on net, but not able to find any Example
which uses the complete syntax of CreateCubeFile method.

Please help if anyone has used this before. It would be gr8 if anyone
can tell me just the complete syntax of this method that he/she may
have used somewhere.

Thanks
SG


Philip

CreateCubeFile Method - RARELY Used - Need urgent help
 
Ok,

* is the sheet name correct?
* is the pivot table called PivotTable1

next,

* Does the path where that cub file will be written by the CreateCubeFile
method of the pivottable exist on the workstation? Can you see it that path
Windows Explorer (C:\Documents and Settings\shegupta\Desktop\) ?
* Does the Pivot Table include information Sales, Product, Company Name ?

I hope that helps...

Philip


"SG" wrote:

Hi,

Please see if anyone can help me with this -

I have written to the following VBA code in excel to automate the
process of Offline Cubes creation :-

Sub UseCreateCubeFile()

Sheets("Sheet2").PivotTables("PivotTable1").Create CubeFile _
File:="C:\Documents and Settings\shegupta\Desktop\Sales.cub",
Measures:=Array("[Sales]"), Levels:=Array("[Product].[Company Name]"),
Properties:=False

End Sub

I am getting the error "Invalid Procedure call or argument".
I have checked extensively the HELP available on MSDN / excel help
files / and searched a lot on net, but not able to find any Example
which uses the complete syntax of CreateCubeFile method.

Please help if anyone has used this before. It would be gr8 if anyone
can tell me just the complete syntax of this method that he/she may
have used somewhere.

Thanks
SG



SG

CreateCubeFile Method - RARELY Used - Need urgent help
 
Yes Philip, I have checked everthing. It's fine, but the code is still
not working.

Its only that I am NOT sure about the syntax that I have used for the
method. And I am not able to find any real example for the same which
uses all the arguments i.e., Measures, Levels and Members for this
method. The excel help file only gives an example with all the
arguments omitted. The excel help file mentions only the following
example:-

Sub UseCreateCubeFile()

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

End Sub


Now the problem is that after lots of searching on net and all the
places I can think of, I am not able to find an example of this method
which uses all the arguments.

1 more doubt I would like to add, is it necessary that the PivotTable
fieldlist is included in the PivotTable for ceating the offline cube
through the code ? Can't the cube pick all the Dimensions and facts
directly from the Pivottable fieldlist instead of the fields being
selected in the PivotTable report.

Thanks
SG



All times are GMT +1. The time now is 11:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com