+ Reply to Thread
Results 1 to 3 of 3

Runtime error (1004) when trying to hide rows containing chart data

  1. #1
    Registered User
    Join Date
    04-07-2016
    Location
    Bury St Edmunds, England
    MS-Off Ver
    2010
    Posts
    8

    Cool Runtime error (1004) when trying to hide rows containing chart data

    Friends...

    I have a sheet which contains input cells, formulae and two charts. One section deals with the result of a physical test (ie plug in the results), with a second section taking an empirical approach. Which is used depends on a variable set in another sheet. I have a 'hidelines' routine which loops down the rows in the sheet and hide/shows each row based on a value in a specified column (23) which is itself set based one the variable in the other sheet. In each section the chart is after the rows containing the chart data.

    When the sheet is activated a routine is run to hide the lines as explained above. The first 25 lines go fine but then just before it gets to the first chart it bombs with Error 1004. In fact it doesn't actually reach the row with the chart. It appears that it can't quite hide the data ranges referred to the chart and it's this that causes the error. These data ranges are approx 5 rows deep but after the error they are represented by a thin horizontal line at the level of the last hidden row.

    I've tried hiding the chart first but this has no effect. It appears the process of hiding rows just can't cope if the rows contain data which is linked to a chart.

    Does anyone have any words of wisdom?

    On a slightly tangential subject I also appear to have issues hiding any ActiveX controls such as option buttons and control boxes which again, don't seem to appreciate being 'hidden' by the row they are on.

    Thank you

  2. #2
    Forum Moderator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    Pro 2019
    Posts
    16,210

    Re: Runtime error (1004) when trying to hide rows containing chart data

    Have you tried manually hiding those rows to see what happens?

    Can you please attach your file?
    Making the world a better place one fret at a time | | |會 |會 |會 |會 | |:| | |會 |會
    Please read the rules
    If someone helped you, click on the star icon at the bottom of their post
    If your problem is solved, go to Thread Tools and select Mark This Thread Solved
    Don't attach a screenshot--just attach your Excel file! It's easier and will let us experiment with your data, formulas, and code.

  3. #3
    Registered User
    Join Date
    04-07-2016
    Location
    Bury St Edmunds, England
    MS-Off Ver
    2010
    Posts
    8

    Re: Runtime error (1004) when trying to hide rows containing chart data

    Hi jazzer, apologies for the delay, but I was travelling...

    Ok when I try and manually hide the rows, which includes the data series and the chart, I get an error stating "Cannot shift objects off of sheet".

    Interestingly I got this same error before when trying to hide columns which included the text boxes of cell comments.

    Hiding just the rows with the data values works fine but it complains about trying to hide the chart.

    Ok, with sheet protection off, if I set the chart format properties to :

    Chart locked, then either

    'Move and size with cells' - hiding the rows works and the chart is hidden too, unhide brings it all back
    'Move but don't size with cells' - hiding the rows around the chart works, but leaves the chart starting at the top of the now hidden rows
    'Don't move or size with cells' - as the one above, hides rows but leaves chart, unhide puts chart back correctly

    With all of the above, trying to hide both data rows and chart together results in the same error message as above.

    Repeating the tests above with chart Locked off and/or Print Object on/off makes no difference

    I also tried hiding the data and chart ranges in two goes data first, then chart or chart rows first, then data rows. in both cases the first hide went fine but I got the same error when trying to hide the second. Excel clearly doesn't like hiding both at the same time!

    Any thoughts ?

    ps it's difficult to post the sheet as it's one of approx 100 in a WB. However if necessary I'll have a go though not sure how to upload here....

    Thanks again. R

+ 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. Runtime Error 1004 in older Excel Versions when updating Chart Series
    By brokenbiscuits in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-14-2015, 08:01 AM
  2. Replies: 13
    Last Post: 01-14-2013, 03:45 PM
  3. Workbook_BeforePrint causes runtime 1004 error only on chart tab
    By AKL01 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-20-2012, 01:51 PM
  4. Cannot copy&paste chart to new sheet (runtime 1004 error)
    By bubastisbastet in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-13-2010, 07:13 AM
  5. runtime error 1004 method rows of object _failed
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-13-2009, 07:26 AM
  6. excel chart export error runtime 1004
    By Mau in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 08-17-2005, 07:05 AM
  7. excel chart export error runtime 1004
    By Mau in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-04-2005, 05:05 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