Results 1 to 13 of 13
  1. #1
    Lounger
    Join Date
    May 2004
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unsupported VBA in 2007? (En/Excel/2007)

    I just got my new machine with Vista and Office 2007. I'm slowly finding my way around and I've discovered a problem with some of my VBA code. I really have two questions - one specific and one more general.

    First, the following code worked fine in Excel 2003 but does not in 2007.

    ActiveChart.ApplyCustomType ChartType:=xlBuiltIn, TypeName:= _
    "Line - Column on 2 Axes"

    The error is

    Run-time error '-2147467259 (80004005)':
    Method 'ApplyCustomType' of object'_Chart' failed

    What should this code look like in Excel 2007? I would re-record the macro but I don't see custom chart formats as an option.

    My second question, does anyone have any resources they can recommend for getting up to speed on Office 2007, VBA, and especially migrating older VBA code into 2007?

    Thanks so much in advance,

    Kevin

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Unsupported VBA in 2007? (En/Excel/2007)

    I don't have Office 2007 yet, so I cannot really help, but the Excel 2007 Developer Reference mentions that many "old" objects, properties and method for charts have been hidden, and new ones have been added. Hopefully someone who has Office 2007 can help.

  3. #3
    Lounger
    Join Date
    May 2004
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Unsupported VBA in 2007? (En/Excel/2007)

    Thanks Hans. What do they mean by "hidden"?

    Kevin

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Unsupported VBA in 2007? (En/Excel/2007)

    Hidden means that the functionality is still present, but it is not exposed to the programmer.
    If you look at the Object Browser (press F2 to see it), you can right-click and select 'Show Hidden Members' from the popup menu to see properties etc. that have been hidden from normal view.

  5. #5
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Unsupported VBA in 2007? (En/Excel/2007)

    Have you checked whether Excel actually has that custom chart type available?
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  6. #6
    Lounger
    Join Date
    May 2004
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Unsupported VBA in 2007? (En/Excel/2007)

    I cannot find any custom chart types in Excel 2007. In 2003, you would go to Insert>Chart and there would be a Custom Types tab. On that tab would be a list of various custom chart types, such as "Line - Column on 2 Axes". In 2007 I can't find custom chart types anywhere.

    Kevin

  7. #7
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Unsupported VBA in 2007? (En/Excel/2007)

    Maybe you have to create one yourself first? I haven't played with that part of 2007 yet.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  8. #8
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Unsupported VBA in 2007? (En/Excel/2007)

    >I've discovered a problem with some of my VBA code.
    I ran extensive tests using Word/VBA on Office2007 and did not find any problems. My tests include the generous use of a 400+ function library of procedures shared across some 20 applications. I made reports in a blog ( Office 2007 for the application developer ) especially in the earlier entries.
    I did not test much in the way of Excel/VBA, and I know that previous versions of Office had different interpretations. That said, the office2007/VBA ought to have been only about implementing an (internal) interface to versions of VBA, rather than rewriting VBA, so i expect everything to work. (Writing an interface to a complex machine is often simpler than building the original machine).
    I would expect all VBA featuresto be supported, and will suspect that any differences are related to the setup. I note a suggestion that perhaps a virgin installation may have, as yet,,no cum chart types.

  9. #9
    Lounger
    Join Date
    May 2004
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Unsupported VBA in 2007? (En/Excel/2007)

    So the custom charts are an option that has to be selected during the install of Excel?

  10. #10
    3 Star Lounger Jim Cone's Avatar
    Join Date
    Feb 2002
    Location
    Portland, Oregon, USA
    Posts
    238
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Unsupported VBA in 2007? (En/Excel/2007)

    This might be of interest...
    http://blogs.msdn.com/excel/archive/...28/724641.aspx
    "Deprecated Features For Charting"
    (Excel 2007 - Eric Patterson - Microsoft)
    --
    Jim Cone
    San Francisco, USA
    http://www.realezsites.com/bus/primitivesoftware

  11. #11
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Unsupported VBA in 2007? (En/Excel/2007)

    > has to be selected during the install of Excel?
    I'm not sure.
    I understood the earlier post to be suggesting that until you had created a custom chart, custom charts were, by definition, not available to you.

  12. #12
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Unsupported VBA in 2007? (En/Excel/2007)

    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  13. #13
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sydney, Australia, New South Wales, Australia
    Posts
    251
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Re: Unsupported VBA in 2007? (En/Excel/2007)

    Re your second question, I've just got this book, and it seems quite comprehensive. There's a whole chapter on charts I haven't got to yet.
    http://www.wrox.com/WileyCDA/WroxTitle/pro...0470046430.html
    Peter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •