+ Reply to Thread
Results 1 to 3 of 3

.MajorUnitScale = xlMonthy -2147467259 (80004005) Error

  1. #1
    Registered User
    Join Date
    11-13-2009
    Location
    Cumbria
    MS-Off Ver
    Excel 2016
    Posts
    87

    .MajorUnitScale = xlMonthy -2147467259 (80004005) Error

    Hi,

    I have wrote a macro that gives a '-2147467259 (80004005)' error for the '.MajorUnitScale = xlMonthy' command on one computer, but no error whatsoever on 3 other computers. Please can someone offer a hint as to why this error might occur as a result of using that command on one computer, but not on 3 others?

    Regards,

    Rowan

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: .MajorUnitScale = xlMonthy -2147467259 (80004005) Error

    It would be easier if we saw the actual code.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    11-13-2009
    Location
    Cumbria
    MS-Off Ver
    Excel 2016
    Posts
    87

    Re: .MajorUnitScale = xlMonthy -2147467259 (80004005) Error

    Here's the code:


    Sub CreateChart()
    Dim ser As Series
    Dim WString As String

    Worksheets("Product Search 2").Shapes.AddChart.Select
    ActiveChart.ChartType = xlLineMarkers
    ActiveChart.HasTitle = True
    ActiveChart.ChartTitle.Text = "Time plot of price (£/kg)"
    ActiveChart.ChartTitle.Font.Size = 25

    For i = ActiveChart.SeriesCollection.Count To 1 Step -1
    ActiveChart.SeriesCollection(i).Delete
    Next i


    Set ser = ActiveChart.SeriesCollection.NewSeries
    With ser
    .XValues = AL
    .Values = AM

    End With

    With ActiveChart

    With .Axes(xlCategory, xlPrimary)
    .CategoryType = xlTimeScale
    .TickLabels.NumberFormat = "dd/mmm/yyyy"
    .TickLabels.Font.Size = 22
    .HasTitle = True
    .AxisTitle.Characters.Text = "Date"
    .AxisTitle.Font.Size = 25
    .MajorUnitScale = xlMonths
    .MajorUnit = 4

    End With

    With .Axes(xlValue, xlPrimary)

    .TickLabels.Font.Size = 22
    .HasTitle = True
    .AxisTitle.Characters.Text = "Price (£/kg)"
    .AxisTitle.Font.Size = 25

    End With

    End With

    With ActiveChart.Parent
    .Left = 20
    .Width = 800
    .Top = 1850
    .Height = 1000

    End With

    With ActiveChart.PlotArea
    .Left = 10
    .Width = 700
    .Height = 800
    .Top = 89

    End With





    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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