Results 1 to 2 of 2
  1. #1
    dgardineer is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Oct 2011
    Posts
    1

    Method InsideHeight of object PlotArea failed

    I'm getting - Method 'InsideHeight' of object 'PlotArea' failed. I'm using Access Automation to build Powerpoint presentations and on a slide where I have 2 charts I'm lining up the 2 chart's plot areas so the data on each chart line up. The error does not happen every time I run the code. It appears to happen randomly. I tried putting a Doevents in the code in case there was a timing issue but that has not corrected it. Now once I get the error and the code breaks I do a next and sometimes it continues and other time I get the error again. If I continue to do Next eventually it continues (could be 3 or 4 times before it runs). Here is my code:

    Public Sub Lineup_Charts(xChart1 As Powerpoint.Chart, xChart2 As Powerpoint.Chart)
    On Error GoTo Lineup_Charts_Err

    Dim sChart1Top As Single
    Dim sChart2Top As Single
    Dim sChart1Left As Single
    Dim sChart2Left As Single

    ' xChart1 is the data Chart
    ' xChart2 is the norm Chart
    '
    DoEvents
    xChart2.PlotArea.InsideHeight = xChart1.PlotArea.InsideHeight ' This is where it fails

    xChart2.PlotArea.InsideWidth = xChart1.PlotArea.InsideWidth
    '
    sChart1Top = xChart1.Parent.TOP + xChart1.PlotArea.InsideTop + xChart1.ChartArea.TOP
    sChart2Top = xChart2.Parent.TOP + xChart2.PlotArea.InsideTop + xChart2.ChartArea.TOP
    If sChart1Top > sChart2Top Then
    xChart2.Parent.TOP = xChart2.Parent.TOP + (sChart1Top - sChart2Top)
    Else
    If sChart1Top < sChart2Top Then
    xChart2.Parent.TOP = xChart2.Parent.TOP - (sChart2Top - sChart1Top)
    End If
    End If
    '
    sChart1Left = xChart1.Parent.Left + xChart1.PlotArea.InsideLeft + xChart1.ChartArea.Left
    sChart2Left = xChart2.Parent.Left + xChart2.PlotArea.InsideLeft + xChart1.ChartArea.Left
    '
    If sChart1Left > sChart2Left Then
    xChart2.Parent.Left = xChart2.Parent.Left + (sChart1Left - sChart2Left)
    Else
    If sChart1Left < sChart2Left Then
    xChart2.Parent.Left = xChart2.Parent.Left - (sChart2Left - sChart1Left)
    End If
    End If
    '
    Lineup_Charts_Exit:


    Exit Sub

    Lineup_Charts_Err:
    gErrorProcedure = "Lineup_Charts"
    DoCmd.OpenForm "GenericErrorForm"
    Resume Lineup_Charts_Exit

    End Sub

    I saw a Post on another site where the author solved the problem in Excel. In that post the answer was turning on ScreenUpdating in Excel. Now as far as I know there isn't a setting for this in Powerpoint. Does anyone have any suggestions on how I could work around this issue? Thanks for the Help!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,913
    This is not an Access issue, it is VBA/PowerPoint question. You might try forum that focuses on PowerPoint programming.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Object doesn't support property or method
    By Jamy in forum Programming
    Replies: 7
    Last Post: 07-15-2013, 01:42 AM
  2. the operation on the ole object failed
    By merlin777 in forum Access
    Replies: 5
    Last Post: 09-05-2011, 05:43 PM
  3. Object does not support this method or property
    By Vronsky in forum Programming
    Replies: 5
    Last Post: 05-30-2011, 02:09 PM
  4. Replies: 5
    Last Post: 08-05-2009, 04:07 PM
  5. Replies: 2
    Last Post: 02-28-2009, 03:31 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums