Consulting

Results 1 to 2 of 2

Thread: Pls help *Urgent* VBA Macro Problem

  1. #1
    VBAX Newbie
    Joined
    Jul 2016
    Posts
    1
    Location

    Pls help *Urgent* VBA Macro Problem

    Hi Everyone,

    I'm new here and hope someone can help.

    I'm building an interactive dashboard in excel, but got stuck editing macro code in order to link chart to control buttons.

    getting a dialogue box with error msg:

    Run-time error '91'
    Object variable or with block variable not set


    when I click debug, I opens VBA


    Sub Daily()
    '
    ' Daily Macro
    '
    '
    With ActiveChart.PivotLayout.PivotTable.CubeFields("[LeviFF1].[Day]")
    .Orientation = xlRowField
    .Position = 4
    End With
    End Sub



    I know I have to declare variable but don't know how pls help

    thanks

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Bad: ("[LeviFF1].[Day]"). . . Unless those square brackets are part of the actual name, then the solution is different

    Good: ("LeviFF1.Day"). . . If that dot is part of the actual name

    If LeviFF1 is an Object and Day is a Property of it, then the above doesn't fit.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

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