+ Reply to Thread
Results 1 to 3 of 3

Thread: error VB code excel 2007

  1. #1
    Registered User
    Join Date
    12-29-2011
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    1

    Red face error VB code excel 2007

    he guys, hows it going? my english is not so good, sorry about that.

    I need you help!
    I have to move some VB excel code from office excel 2002 to office excel 2007.
    But I have problem to change the type of graphics.
    I think the problem is when I put the name of the graphic.

    here I assign the name of the graphic for the 2002 version.

    excelSheet.Shapes(excelSheet.Shapes.Count).name = "graphic1"

    after in other method I valid the selected option

    Case type1
    excelSheet.ChartObjects("graphic1").Chart.ChartType = xlColumnClustered

    Case type2
    excelSheet.ChartObjects("graphic1").Chart.ChartType = xl3DArea


    this code work perfect in 2002 version, but it doesn't work in 2007 version

    the error is like "not found element with name specified" in english

    How can i put the name of the graphic in 2007?
    I think is different way.....help please guys! :D

    someone understand me? My English sucks....

  2. #2
    Valued Forum Contributor MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    5,282

    Re: error VB code excel 2007

    Hi Eddie and welcome to the forum,

    Click on the chart in your 2007 and see if it has a name other than "graphic1". I'd bet the name has changed to something else. Change "graphic1" to the new name and try again.
    One test is worth a thousand opinions.
    Click the * below to say thanks.

  3. #3
    Valued Forum Contributor
    Join Date
    07-21-2008
    Location
    London, UK
    Posts
    326

    Re: error VB code excel 2007

    Check graphic1 exists if not find out what it is called and edit the code to suit the correct name

    Step though teh code to made sure where / if the code bombs and the full error message and post back

+ 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.2.0