+ Reply to Thread
Results 1 to 10 of 10

My Excel 2003 vba code does not work in excel 2010. Somebody help!

  1. #1
    Registered User
    Join Date
    01-31-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    64

    My Excel 2003 vba code does not work in excel 2010. Somebody help!

    Please Login or Register  to view this content.
    Does anyone know what the problem is?
    Last edited by JosephP; 02-01-2013 at 09:02 AM. Reason: add code tags

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,885

    Re: My Excel 2003 vba code does not work in excel 2010. Somebody help!

    You say it does not work. What happens when you run the code. Do you get a compile error? If so, on what line?

    Have you debugged the code?

    Look here: http://www.cpearson.com/excel/DebuggingVBA.aspx
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    01-31-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    64

    Re: My Excel 2003 vba code does not work in excel 2010. Somebody help!

    Thank you for the answer.

    I get the following runtime error message:
    Runtime nr: -2147417848 (80010108)
    Method 'Value' Of Object 'Range' Failed.


    Then the excel workbook closes down.

  4. #4
    Registered User
    Join Date
    01-31-2013
    Location
    Winslow, AZ
    MS-Off Ver
    Excel XP
    Posts
    3

    Re: My Excel 2003 vba code does not work in excel 2010. Somebody help!

    Do you have a named range that is only three letters long or three letters then numbers? Just asking because thats OK in 2003, but in 2010 that will reference a column (probably several thousand columns over from where you want) instead of your named range.

  5. #5
    Registered User
    Join Date
    01-31-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    64

    Re: My Excel 2003 vba code does not work in excel 2010. Somebody help!

    Well, i am not quite sure. Can you see if I have done this?

    I have pasted in my code in the thread's first post.

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,885

    Re: My Excel 2003 vba code does not work in excel 2010. Somebody help!

    DeNam;
    Bloodmeat is referring to named ranges in your spreadsheet and not in your VBA code. Have your stepped through your code using the F8 key to see where the code fails? Or if you run the compile it will highlight the line of code that is failing.

  7. #7
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: My Excel 2003 vba code does not work in excel 2010. Somebody help!

    you are changing the sheet from a change event which will trigger the change event again and again and again...

    you need to use
    Please Login or Register  to view this content.
    at the start of the code and
    Please Login or Register  to view this content.
    at the finish
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  8. #8
    Registered User
    Join Date
    01-31-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    64

    Re: My Excel 2003 vba code does not work in excel 2010. Somebody help!

    Is it possible to do on a private worksheet sub?

    I am not able to step through using the F8 key.

  9. #9
    Registered User
    Join Date
    01-31-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    64

    Re: My Excel 2003 vba code does not work in excel 2010. Somebody help!

    Thanks JosephP, your answer seems to have solved the problem.

    Any ideas why it worked without in Excel2003?

  10. #10
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: My Excel 2003 vba code does not work in excel 2010. Somebody help!

    excel 2003 was more lenient in many ways but the code really should always have had the lines I suggested

+ 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