+ Reply to Thread
Results 1 to 6 of 6

VBA and Charts in Excel 2007

  1. #1
    Forum Contributor
    Join Date
    08-22-2005
    Location
    Denmark
    MS-Off Ver
    Excel 365
    Posts
    349

    VBA and Charts in Excel 2007

    I have a piece of code that arranges a chart to fit the data it should show. The code used to work perfectly in the old Excel version, but after an "upgrade" to Excel 2007 I get "Automation Error" from the line where the scale type is set.

    Please Login or Register  to view this content.
    If I click "Help" on the error message, I am told to insert a "Microsoft Outlook 2002" disk, but I don't have that and I fail to se the relevance.

    How do I set the scale type in Excel 2007?

    I know I should not 'select', but I have copied the method directly from the recorder. If someone can show me how to write the instructions without selecting, please do so.

    NSV
    Last edited by nsv; 02-17-2010 at 09:32 AM.

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

    Re: VBA and Charts in Excel 2007

    It would help is you could post example of the chart you are running this code against.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    08-22-2005
    Location
    Denmark
    MS-Off Ver
    Excel 365
    Posts
    349

    Re: VBA and Charts in Excel 2007

    Hi Andy

    Thanks for the quick response.
    I attach the complete workbook with a number of sheets.
    Sheet 'Histo' has the chart as push button for the macro and it makes this Automation error.
    Sheet 'Prob' has a separate push button and works without problems.
    Sheet 'Weibull' has a separate push button and fails, but in a more instructive manner than 'Histo'.

    NSV
    Attached Files Attached Files

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

    Re: VBA and Charts in Excel 2007

    Looks like setting the Scaletype is bugged. But only for charts with mixed chart types.

    As long as you are not changing the scale type you can use the following edit.

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    08-22-2005
    Location
    Denmark
    MS-Off Ver
    Excel 365
    Posts
    349

    Re: VBA and Charts in Excel 2007

    Thanks for the explanation, Andy

    Do you think someone will correct the bug? It ought to be possible to set the scale in VBA.

    I can of course just remove the line and solve this specific case, but sometimes the data is not linear and I then manipulate the scale manually to see if it fits. That is why I keep this scale setting instruction to be sure it is reset when running the macro.

    NSV

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

    Re: VBA and Charts in Excel 2007

    I will report it as a bug. But don't hold your breath

+ 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