+ Reply to Thread
Results 1 to 20 of 20

Macros written in Excel 2010 don't work in Excel 2013

  1. #1
    Registered User
    Join Date
    11-06-2013
    Location
    Phoenix, az
    MS-Off Ver
    Excel 2013
    Posts
    26

    Macros written in Excel 2010 don't work in Excel 2013

    I've created several workbooks that hold code to manipulate data in other workbooks. We usually open the spreadsheet with the code then open the workbook with the data. Sometimes it involves a 3rd workbook used as a template.
    A few computers at the office are running Excel 2013 and these macros will not run on them. Excel 2013 doesn't seem to know that there is more than one workbook open since they appear in their own windows. The macro makes pretty straight forward commands as to which workbooks it wants to work with (Workbooks(1).Activate, Workbooks(2).Sheet(1).Range("A1").Select.....etc). But I get error after error. I create these "utilities" (as I like to call them) on a computer with Excel 2010 and everything works just fine. Some of these utilities even run on machines running Excel 2003 without a problem. Unfortunately I can't get on one of these machines using 2013 to do any debugging. I typically get to see the error, take a quick look at the command that caused the problem and then try to research it. One of the resent errors was a straight forward unhide a column command but the column was already unhidden so it crashed. Excel 2010 just ignores the command since it's already unhidden.

    Any advice or help to point me in the direction as to what I'm doing wrong would be appreciated.

    Thanks

  2. #2
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13
    Posts
    953

    Re: Macros written in Excel 2010 don't work in Excel 2013

    Hi Bukovnik,

    Usually with newer versions, there is a newer Reference Library that needs to be added to the IDE.

    Open Visual Basic >> Go to Tools >> References & check the checkbox for the latest version of Excel & Office - you may need to scroll down to the 'M's in the list as it's alphabetical.

    Uncheck the old version from the list.

    Let me know if this helps?

    If not, please let me knoe the exact error. Cheers
    Remember you are unique, like everyone else

  3. #3
    Registered User
    Join Date
    11-06-2013
    Location
    Phoenix, az
    MS-Off Ver
    Excel 2013
    Posts
    26

    Re: Macros written in Excel 2010 don't work in Excel 2013

    Am I adding this library to Excel 2010 or 2013? I'm showing version 14 currently installed in Excel 2010.

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    2013 on Win10 (desktop), 2007 on Win10 (notebook)
    Posts
    8,019

    Re: Macros written in Excel 2010 don't work in Excel 2013

    Hi, Bukovnik,

    maybe the problem is with what has been referenced in 2010 but isnīt available on the computers with 2013? Maybe look for referencees which arenīt available and uncheck these.

    The macro makes pretty straight forward commands as to which workbooks it wants to work with (Workbooks(1).Activate, Workbooks(2).Sheet(1).Range("A1").Select.....etc).
    Not the way a profound programming would go to my opinion where you would build references and work with these instead of unreliable circumstances as the first workbook opened in an instance or the first available sheet in a workbook (which may not be a worksheet as any user might have dragged a chart to the front).

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  5. #5
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13
    Posts
    953

    Re: Macros written in Excel 2010 don't work in Excel 2013

    Whichever workbook gives you the error.

  6. #6
    Registered User
    Join Date
    11-06-2013
    Location
    Phoenix, az
    MS-Off Ver
    Excel 2013
    Posts
    26

    Re: Macros written in Excel 2010 don't work in Excel 2013

    I would think that 2013 would certainly remain compatible with 2010.
    I could not think of any other way to build macros to work with workbooks of unknown names other than to reference them logically (1, 2, 3...etc). Since I always know the name of the workbook containing the the macro I can always tell which order the workbooks were loaded. Like I said, these macro run fine on 2010 (and 2003 w/minor adjustments for that version). I will check the installation of 2013 for anything that looks like it may need to run these macros.
    No one else having similar problems like this?

  7. #7
    Registered User
    Join Date
    12-20-2013
    Location
    Switzerland
    MS-Off Ver
    Excel 2013
    Posts
    1

    Re: Macros written in Excel 2010 don't work in Excel 2013

    Hi I have same issues with 2013 with running a macro from a large workbook which imports data files one by one, calculates out and pastes the output onto a front sheet row by row then saves the new data with trading signals as a CSV file and closes it before going to the next. Takes 10 times as long as 2010, looks like it's semi crashed, pastes the data but doesn't save any CSV files. Before I downgrade (and pull what little hair I have left out!)interested to see any other postings Bukovnik's query raises. Thanks

  8. #8
    Registered User
    Join Date
    11-06-2013
    Location
    Phoenix, az
    MS-Off Ver
    Excel 2013
    Posts
    26

    Re: Macros written in Excel 2010 don't work in Excel 2013

    Well, I've checked the Reference Libraries for the 2010 and 2013 installations. Excel 2010 has version 14.0 and 2013 has version 15.0 (as I would expect). I don't know much about these libraries but from what reseach I've done, it seems that the version 15 cannot be installed in Excel 2010 and version 15 which is in Excel 2013 should already be compatable with the version 14 library. So I don't think this is the problem. As I said in the orginal post, the errors I get from Excel 2013 are on very basic commands like activating another loaded workbook. My thought is that since Excel 2013 handles workbooks in seperate instances of Excel, they might have to be addressed differently in the macro (something more than just (Workbooks(1), Workbooks(2), etc..). I guessing that each instance of Excel is using Workbooks(1) since they are seperate. I can't get onto one of the computers with Excel 2013 to test any of these theorys. Can anyone using Excel 2013 verify this?

  9. #9
    Forum Contributor
    Join Date
    10-30-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 2013
    Posts
    173

    Re: Macros written in Excel 2010 don't work in Excel 2013

    Are you sure the problem is the excel version?
    Why do you think using the numerical index for the workbooks collection is a good idea? As pointed out by @HaHoBe this is not good practice. How does your code ensure that correspondence between the index number and the workbook is always correct?

  10. #10
    Registered User
    Join Date
    11-06-2013
    Location
    Phoenix, az
    MS-Off Ver
    Excel 2013
    Posts
    26

    Re: Macros written in Excel 2010 don't work in Excel 2013

    Since I never know what the name of the workbooks will be the only way to access them is by index number (initially). The code usually starts by checking which workbook is loaded:
    If Workbooks(1)=Thisworkbook then
    wkbk1=Workbook(1).name
    wkbk2=Workbook(2).name
    else
    wkbk1=Workbooks(2).name
    wkbk2=Workbooks(1).name
    end if

    How else would you do it? But besides that, Excel 2013 doesn't seem to like it in the macros that we've tried. This seems pretty simple and straight forward to me. Why wouldn't Excel 2013 recognize Workbook(1) or Workbook(2) without producing an error?

  11. #11
    Forum Contributor
    Join Date
    10-30-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 2013
    Posts
    173

    Re: Macros written in Excel 2010 don't work in Excel 2013

    ThisWorkbook is the workbook containing the macro and is not always the same as the ActiveWorkbook or Workbook(1).

    How else would you do it?
    There are many ways to do it, for example, add some feature to each workbook that allows you to identify it. Either by naming convention or by a hidden name or just a standard sheet name that is the same for all with identity information in a standard location.

    Excel 2013 doesn't seem to like it in the macros that we've tried....
    Why wouldn't Excel 2013 recognize Workbook(1) or Workbook(2) without producing an error?
    Perhaps if you give some specific information... what Error is it throwing?
    Last edited by coolblue; 12-26-2013 at 10:57 PM.

  12. #12
    Registered User
    Join Date
    11-06-2013
    Location
    Phoenix, az
    MS-Off Ver
    Excel 2013
    Posts
    26

    Re: Macros written in Excel 2010 don't work in Excel 2013

    If I had access to the spreadsheets I could see using the methods you've described. Unfortunately this data is coming down the proverbial pike from the corporate office in Denver. They send down these huge spreadsheets and then want the office I'm in, to pull data. The file names are always different because they use dates within the file name. However the data in the workbooks is always the same format.
    One of my co-workers, who has Excel 2013 on their computer, is going to try running one of the macros to generate a report this coming Monday. I don't think we've tried this one on Excel 2013. I'll try to get details on the errors and post them here next week. Thanks for your reply.

  13. #13
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,417

    Re: Macros written in Excel 2010 don't work in Excel 2013

    Hi @Bukovnik,

    To really get a solid answer, you will probably need to provide dummy copies of the workbooks being used and the macros. We don't need to see any of the actual data, but the file structure needs to stay the same. Also if the files (or worksheets) have a specific naming scheme then you can mock them up but keep the scheme the same. It shouldn't be as hard as you imagine, but we could keep guessing all day about where the problem lies but without testing solutions on Excel 2013 no one can confidently tell you why you are having this problem.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  14. #14
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013
    Posts
    17,569

    Re: Macros written in Excel 2010 don't work in Excel 2013

    That code should not work in any version of Excel.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  15. #15
    Forum Contributor
    Join Date
    10-30-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 2013
    Posts
    173

    Re: Macros written in Excel 2010 don't work in Excel 2013

    Ok. I guess my point is that you need to have a well defined structure for registering and definitively reference the different spreadsheets and until you do, it's probably not productive to lay the blame with excel just yet.

    I have been working with excel 2010 and 2013 a lot lately and I have not noticed any issues going from 2010 to 2013. Many, MANY times I've been frustrated and annoyed with excel, but 99.9% of the time it's me that's the problem.

  16. #16
    Registered User
    Join Date
    03-02-2015
    Location
    Sao Paulo
    MS-Off Ver
    2010
    Posts
    1

    Re: Macros written in Excel 2010 don't work in Excel 2013

    Hi everyone,

    I am replying on this thread because I have the same problem. I finished a report, whose charts are automatically updated by excel macros after the user inputs necessary data. I just sent it to my superior, who is going to use this excel file, but some of the macros will not run appropriately on his Excel 2013.

    One of the problems is the Activex form buttons. None of the buttons I created work. They do not hide and unhide the cells I programmed them to. I suppose it is related to this post:
    http://blogs.technet.com/b/the_micro...-updates-.aspx

    The other problem is a macro created to export the charts in image format into a new excel file, so as to facilitate copying and pasting them to ppt. But it runs crazy on excel 2013.

    I do not have excel 2013 to debug it, but I could notice what the macro is not able to do by seeing the result. It is not changing worksheets, so it is basically copying and pasting cells in the same worksheet you run the macro. And then it is not separating anything into a new separate file.

    So, basically, the following commands are not working on Excel 2013:

    This is how I am changing spreadsheets:
    Sheets("Example").Select

    This is how I am creating worksheets based on a Blank template:
    Sheets("Blanksheet part 1").Copy after:=Sheets(Sheets.Count)
    Sheets("Blanksheet part 1 (2)").Name = "Part_1"

    This is how I am creating the new file with the worksheets the macro just filled with images:
    Sheets(Array("Part_1", "Part_2", "Part_3")).Select
    Sheets(Array("Part_1", "Part_2", "Part_3"))).Move

    As I mentioned, these lines work perfectly on excel 2010, but do not work on Excel 2013. Does anybody know how they should be written to work on Excel 2013?

    I appreciate your help.

    Thanks a lot

  17. #17
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13
    Posts
    953

    Re: Macros written in Excel 2010 don't work in Excel 2013

    Hi Bacarin,

    You need to post this as a new issue.

    Then someone may be able to help you.

    Cheers

  18. #18
    Forum Contributor
    Join Date
    07-25-2012
    Location
    Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    170

    Re: Macros written in Excel 2010 don't work in Excel 2013

    sorry i add my question here as my question and problem are almost similar type ....
    My Macros which i created in 2010 not working in 2013......Error :: Macros disable.......
    i already enable Macros from Trusted Setting....

    Please guide me .
    Regards

  19. #19
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 2000/3/7/10/13/16
    Posts
    50,561

    Re: Macros written in Excel 2010 don't work in Excel 2013

    waqarqrl Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  20. #20
    Forum Contributor
    Join Date
    07-25-2012
    Location
    Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    170

    Re: Macros written in Excel 2010 don't work in Excel 2013

    Thanks Dear

    I already post my problem in new thread but didnt recieve any response, then i find this thread which similar type to me thats why i post question here.
    any way i again try to post my question.
    Regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. convert vba written in excel 2010 to excel 2003
    By excelandclark in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-03-2013, 08:08 PM
  2. Excel 2010 VBA & Macros - Wont work in Open Office
    By galvinpaddy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-31-2013, 04:49 AM
  3. Shared Excel 2010 File with macros that do not work
    By Dave Herbert in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-06-2012, 10:35 AM
  4. Macros Written in Excel 2003 Problems in Excel 2010
    By timbo1957 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-27-2012, 09:01 AM
  5. Macros written in Excel 97 will not work in Excel 2003
    By Jason Hanson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-20-2006, 11:15 PM

Tags for this Thread

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