Results 1 to 1 of 1

Automation Error: Invalid Oleverb Structure when Creating Chart

Threaded View

  1. #1
    Registered User
    Join Date
    08-07-2013
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    1

    Automation Error: Invalid Oleverb Structure when Creating Chart

    Hi all,

    I am trying to create an excel chart and automate the process.

    I have only one column to plot and has close to 360 rows. When I run this piece of the code, I am getting the error "Automation error: Invalid Oleverb Structure"

    Can someone help me with this? Google didnt seem to have enough resources.

    Thanks in advance.



    Workbooks.Open Filename:=Final_Path & "\" & "Dist Users Minute.csv"               
    
    n_row = ActiveSheet.Range("B1").Offset(ActiveSheet.Rows.Count - 1, 0).End(xlUp).Row
    
    Set c = ActiveWorkbook.Charts.Add
    Set c = c.Location(Where:=xlLocationAsObject, Name:="Dist Users Minute")
    With c
       .ChartType = xlColumnClustered
       .SetSourceData Source:=Sheets("Dist Users Minute").Range("B2:B" & n_row), PlotBy:= _
             xlRows
        .HasTitle = True
        .ChartTitle.Text = "Dist Users Minute"
        .Axes(xlCategory, xlPrimary).HasTitle = True
        .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Hour"
        .Axes(xlValue, xlPrimary).HasTitle = True
        .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Dist Users"
        .HasLegend = False
        .Parent.Top = Range("D3").Top
        .Parent.Width = Range("D3:M20").Width
        .Parent.Height = Range("D3:M20").Height
    
    End With
    Last edited by Leith Ross; 08-07-2013 at 05:28 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Creating A Org Structure
    By j4rowell in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-05-2012, 02:34 PM
  2. Chart error--invalid references
    By jeffreybrown in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 12-30-2009, 08:24 AM
  3. "Invalid procedure call or argument" error when creating Pivot table
    By Kaigi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2009, 06:02 AM
  4. Automation error when creating graphs
    By tacojoe in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-12-2008, 12:20 PM
  5. Error Creating Chart
    By jclark419 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-25-2006, 01:40 PM

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