+ Reply to Thread
Results 1 to 6 of 6

Macro works fine in 2010, Crashing in 2003 - Posting problem code - Please Help?

  1. #1
    Registered User
    Join Date
    09-18-2012
    Location
    United States
    MS-Off Ver
    Excel 2010 / 2007 / 2003 / 1997
    Posts
    5

    Macro works fine in 2010, Crashing in 2003 - Posting problem code - Please Help?

    Here's a small chunk of code in a rather involved Macro that is working fine in 2010, but crashing in 2003

    Can someone help? I would like it to run in Excel as far back as 2003, don't really care about anything older.

    It is code that creates and populates a chart 'title' text box.

    Please Login or Register  to view this content.
    Also, notably, the last line was all I could do to get VBA to populate a textbox with formula.....

    Any help would be great - In 2003, the macro crashes, Runtime Error 438, in the first section of code, lines:

    Please Login or Register  to view this content.
    Arrow on the last line

    Not really sure what's up..... but it's something 2003 doesn't like.


    THANK YOU!!!!
    Last edited by RDAmidwest; 12-11-2012 at 01:49 PM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Macro works fine in 2010, Crashing in 2013 - Posting problem code - Please Help?

    Hi,

    A quick search on error 438 shows this site and possible answer http://excelsuperstar.com/2011/11/vba-error-438/
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro works fine in 2010, Crashing in 2013 - Posting problem code - Please Help?

    We are not 2013 yet,but we seem to have excel 2013. I wonder how many people have already got it.

  4. #4
    Registered User
    Join Date
    09-18-2012
    Location
    United States
    MS-Off Ver
    Excel 2010 / 2007 / 2003 / 1997
    Posts
    5

    Re: Macro works fine in 2010, Crashing in 2013 - Posting problem code - Please Help?

    Hahahhaa. Nice. Sorry, all this time travel gets a guy flustered.... typo fixed.

    @MarvinP

    Not really sure how I would apply that to my code..... you think it's in the first line of:

    Please Login or Register  to view this content.
    ^That is the code that debugger highlights....

    I'm fairly new with VBA, and so I've been using record, google, F1, and trial and error a lot.

    So, based on 438, I should be losing "Selection" ? or losing "TextRange.Characters" ?? I'm pretty lost.

  5. #5
    Registered User
    Join Date
    09-18-2012
    Location
    United States
    MS-Off Ver
    Excel 2010 / 2007 / 2003 / 1997
    Posts
    5

    Re: Macro works fine in 2010, Crashing in 2003 - Posting problem code - Please Help?

    Ok, thanx to a friendly mr A.Poulsom, I am now aware there is no TextFrame2 property in Excel 2003 (probably not in 2013 either)

    Like I said, I'm a bit of a noob with this, so I don't understand how to correct it....

    The first section of code is referring to a textbox on a chart with the name TextBox 1 when hovered
    The second section is referring to a textbox on a chart with the name TextBox 2 when hovered

    The rest of the textbox references in the code are from a UserForm .... so , yeah... my brain might start hurting here and this is propably what should be the easies part of this whole stinking thing.

    Everything was fine till I started trying to automate my chart title dangit ....

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Macro works fine in 2010, Crashing in 2003 - Posting problem code - Please Help?

    Hi,

    I remember there was a "new charting engine" with newer versions of Excel. Read http://peltiertech.com/WordPress/cha...in-excel-2007/

    My suspicion is that "new" means they created more and different objects to enable new features in charting and make the new engine more compatible with existing objects.

    I'm not sure you really want to have to learn the old object model and make it work with your new model code. (Assuming that object changes is what is causing the error)

  7. #7
    Registered User
    Join Date
    09-18-2012
    Location
    United States
    MS-Off Ver
    Excel 2010 / 2007 / 2003 / 1997
    Posts
    5

    Re: Macro works fine in 2010, Crashing in 2003 - Posting problem code - Please Help?

    Posting my solution in case anyone finds it helpful.

    Here's the corrected code:

    Please Login or Register  to view this content.
    Excel 2010 has many more functions than 2003.
    Notably, much in the area of graphical stuff (ie, charts, textboxes, shapes, etc etc)

    My issues were with the way I was calling on objects/shapes - and the big kicker: AddLabel -vs- AddTextbox

    Excel 2003 will not use AddLabel - it will run without error, but will not create the textbox..... terminology, though, I'm sure there must be some reason for the addition in 2010????

    At any rate..... maybe this will help someone.

+ 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