+ Reply to Thread
Results 1 to 5 of 5

Charts not reacting although macro working following upgrade to Excel 2016

  1. #1
    Registered User
    Join Date
    08-30-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    19

    Charts not reacting although macro working following upgrade to Excel 2016

    Hi

    I have a workbook looking at a time series of population data. When the macro is run the data is updated every second with the following years data. This continues until the final year of data is displayed. A chart is based on this data and the idea is that when the macro is run the data is updated and the chart displays the changing population year on year.

    We have recently upgraded to Excel 2016 and while the macro still works and the data still updates the chart does not until the macro finishes, then the chart displays the data from the final year.
    When viewed in an older version of Excel the macro works, the data updates and the chart updates as well

    I really don't understand why the data is updating but the chart isn't and I'm hoping one of you very clever people can help me. I'm wondering if I need a line of code after the data updates each time which forces the chart to update?

    This is a sample of the macro. It repeats 26 times until it reaches the end of the timeseries.

    Sub AnimatePyramid()
    '
    ' AnimatePyramid Macro


    DelayTime = TimeValue("00:00:01")

    ScreenUpdating = False


    ActiveSheet.Range("L1").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("m1").Select
    Application.Wait Now + DelayTime
    ActiveSheet.Range("L1").Select
    ActiveCell.FormulaR1C1 = "2"
    Range("m1").Select
    Application.Wait Now + DelayTime
    ActiveSheet.Range("L1").Select
    ActiveCell.FormulaR1C1 = "3"
    Range("m1").Select
    Application.Wait Now + DelayTime

    ScreenUpdating = True


    End Sub

  2. #2
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Charts not reacting although macro working following upgrade to Excel 2016

    Have you tried commenting out the ScreenUpdating = False line?

  3. #3
    Registered User
    Join Date
    08-30-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Charts not reacting although macro working following upgrade to Excel 2016

    Yes I've tried that and it makes no difference.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,419

    Re: Charts not reacting although macro working following upgrade to Excel 2016

    The screenupdating in this case will make no difference as you are missing the Application object. In your code it is just a variant variable you are changing.

    try adding in some Doevents. With xl2016 you need a couple more than previous versions

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  5. #5
    Registered User
    Join Date
    08-30-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Charts not reacting although macro working following upgrade to Excel 2016

    Thank you so much Andy that has done the trick.
    My knowledge of vba is somewhat limited so I haven't got a clue what it means but it works

    Love your own website and have often used it for charting tips.
    I can't believe THE Andy Pope solved my problem!

+ 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. Macro not working excel 2016
    By knuttybuddy in forum Excel General
    Replies: 4
    Last Post: 02-05-2018, 03:59 PM
  2. 2010 Macro not working in 2016 Excel
    By porepiga in forum Excel General
    Replies: 7
    Last Post: 04-18-2017, 12:11 PM
  3. Histogram Charts in Excel 2016
    By gballard in forum Excel General
    Replies: 1
    Last Post: 08-25-2016, 06:46 AM
  4. Replies: 0
    Last Post: 05-17-2016, 12:39 PM
  5. Replies: 2
    Last Post: 05-17-2016, 12:23 PM
  6. Macro From Excel 2013 Not Working in 2016
    By tm1238 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-08-2016, 04:39 PM
  7. Excel 2016 upgrade added password
    By laguna92651 in forum Excel General
    Replies: 0
    Last Post: 12-22-2015, 07:01 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