+ Reply to Thread
Results 1 to 2 of 2

VBA OLAP Help

  1. #1
    Registered User
    Join Date
    07-08-2014
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    3

    Question VBA OLAP Help

    I am working on a project for my internship in which I am trying to automate a spreadsheet by writing a macro. What I have done is created a very small pivot table in the Homepage, with the report filter being "Resource Name." This report value gives the output at Cell "B8." From there, I used the split function because I want to create a sheet in a new tab that is named after the last name of the person selected in "B8" of "Homepage."

    I then want to create a Pivot Table in the new sheet I just created. I should mention that the Pivot Table is drawing data from an OLAP Cube. I suspect the value I have in "TableDestination" is in the wrong notation. If someone could point me in the right direction, I would greatly appreciate it.

    Sub ProjectLeadHome()
    '
    Dim Name As String
    Dim i As Integer
    Dim FullName As Variant

    ' Obtain name of chosen resource

    Name = Worksheets("Homepage").Range("B8").Value
    FullName = Split(Name, " ")

    ' Obtain last name from array

    Dim LastNameNumber As Integer
    LastNameNumber = UBound(FullName)

    ' Add worksheet with the last name of the resource

    Sheets.Add(, Worksheets("Homepage")).Name = FullName(LastNameNumber)

    ActiveWorkbook.PivotCaches.Create(SourceType:=xlExternal, SourceData:= _
    ActiveWorkbook.Connections("Connection"), Version:=xlPivotTableVersion14). _
    CreatePivotTable TableDestination:=Worksheets(FullName(LastNameNumber)), TableName:="Lead", _
    DefaultVersion:=xlPivotTableVersion14

    End Sub

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,317

    Re: VBA OLAP Help

    The destination needs to be a specific cell not just a worksheet.
    Everyone who confuses correlation and causation ends up dead.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] OLAP
    By Gregc. in forum Excel General
    Replies: 0
    Last Post: 08-08-2006, 10:40 PM
  2. [SOLVED] OLAP & Excel
    By Luca Bovo in forum Excel General
    Replies: 0
    Last Post: 08-01-2006, 11:15 AM
  3. OLAP Question
    By Stix_1998 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-13-2006, 12:20 PM
  4. OLAP Cubes
    By Steven Cheng in forum Excel General
    Replies: 1
    Last Post: 09-16-2005, 01:05 AM
  5. [SOLVED] Beginners OLAP
    By Jonathan in forum Excel General
    Replies: 1
    Last Post: 05-22-2005, 05:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1