+ Reply to Thread
Results 1 to 13 of 13

Excel 2010 will not run through VBA created 2007

  1. #1
    Registered User
    Join Date
    05-08-2012
    Location
    Texas
    MS-Off Ver
    Excel 2003
    Posts
    20

    Excel 2010 will not run through VBA created 2007

    Many thanks to jaslake for all the help in the past on this project.

    I recently had to get a new computer which has Excel 2010, previous version was 2007. When I run the macro/VBA it gets most of the work done except for the create monthly summary portion it just force closes. It's put me in a bit of a bind and I've spent countless hours adjusting all settings I can find and reading online about compatibility.

    Do you have any insight or know of anything that might need to be changed within the code? Since it does run most of the code it makes me think perhaps something needs to be changed for 2010 specifically within that portion which causes it to force close.

    Many thanks in advance!
    Attached Files Attached Files
    Last edited by ccampb1346; 03-31-2014 at 12:26 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Excel 2010 will not run through VBA created 2007

    I want to reproduce this but I don't know what what to do to be able to see the problem occur, and I want to understand what problem you are seeing.

    Which code are you running? How are you initiating it? What does "it just force closes" mean?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Excel 2010 will not run through VBA created 2007

    Hi Charles

    It'll take me a bit to get up to speed on what the Code is doing. I've changed operating systems and, although I probably have the original project somewhere on backup, finding it could be a royal pain.

    I do have Excel 2010 so, please point out in what Module and where and what line of Code is causing the issue.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Registered User
    Join Date
    05-08-2012
    Location
    Texas
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: Excel 2010 will not run through VBA created 2007

    On the statement tab the 'Run Forecast' button initiates the protocol to run all of the various code. On my machine it goes through all of the steps except on the last one 'create monthly summary' it creates the file titled with the month (ex. 0414) and formats it with the headings in the master spreadsheet tab '0213' but at that point when it should populate the various data it just force closes.

    I do not know how to locate the error in the code.

  5. #5
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Excel 2010 will not run through VBA created 2007

    I'm thinking the FileFormat:=51 is causing the problem....but Jazzer and jaslake bring up a good point....can you step through (F8) the Create Monthly Summary Module and find out what line is actually causing the problem?
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  6. #6
    Registered User
    Join Date
    05-08-2012
    Location
    Texas
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: Excel 2010 will not run through VBA created 2007

    Quote Originally Posted by judgeh59 View Post
    I'm thinking the FileFormat:=51 is causing the problem....but Jazzer and jaslake bring up a good point....can you step through (F8) the Create Monthly Summary Module and find out what line is actually causing the problem?
    Once I've stepped through how do I know which line is creating the problem? Thanks!

  7. #7
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Excel 2010 will not run through VBA created 2007

    I guess if you can step through that module the problem is not is that module....I guess I got the impression that you knew it was "forcing a close" in the Create Monthly Summary module...you can literally just keep pressing F8 until something fails and then noting what line of code that was....you can setup break points to let the code to a certain point and then step through....

  8. #8
    Registered User
    Join Date
    05-08-2012
    Location
    Texas
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: Excel 2010 will not run through VBA created 2007

    Quote Originally Posted by judgeh59 View Post
    I guess if you can step through that module the problem is not is that module....I guess I got the impression that you knew it was "forcing a close" in the Create Monthly Summary module...you can literally just keep pressing F8 until something fails and then noting what line of code that was....you can setup break points to let the code to a certain point and then step through....
    It closes on the Open Customer Files window, LN 70 Active Workbook.Close False

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Excel 2010 will not run through VBA created 2007

    Hi Charles

    I can't run your Code from start to finish without commenting out some lines of Code as there is a File missing on my platform "Workbooks("Internal Summary Template.xlsx") and perhaps others. However, the premature Close of the File is caused by this Line of Code In Module OpenCustomerFiles, Sub selectfiles(spath)

    Please Login or Register  to view this content.
    In the Immediate window it evaluates to "Microsoft Office Excel 2007 Workbook"

    That's what triggers the File Close later in the Sub. Change it in the Code...see what happens...

    FYI: On my platform, the same issue is exhibited in Excel 2007
    Last edited by jaslake; 03-29-2014 at 11:30 AM.

  10. #10
    Registered User
    Join Date
    05-08-2012
    Location
    Texas
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: Excel 2010 will not run through VBA created 2007

    Quote Originally Posted by jaslake View Post
    Hi Charles

    I can't run your Code from start to finish without commenting out some lines of Code as there is a File missing on my platform "Workbooks("Internal Summary Template.xlsx") and perhaps others. However, the premature Close of the File is caused by this Line of Code In Module OpenCustomerFiles, Sub selectfiles(spath)

    Please Login or Register  to view this content.
    In the Immediate window it evaluates to "Microsoft Office Excel 2007 Workbook"

    That's what triggers the File Close later in the Sub. Change it in the Code...see what happens...

    FYI: On my platform, the same issue is exhibited in Excel 2007
    I found that line of code but I do not see the immediate window reference to Excel 2007? How do I find and change it?

    Thanks!

  11. #11
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Excel 2010 will not run through VBA created 2007

    Hi Charles

    Put a Break Point at that Line of Code. Run the Code...the Code will pause at the Line. Open the Immediate Window (View--->Immediate Window).
    In the Immediate Window type----> ?file.type --->Enter.

    What's it say? Change that Line of Code to whatever it says.

  12. #12
    Registered User
    Join Date
    05-08-2012
    Location
    Texas
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: Excel 2010 will not run through VBA created 2007

    Quote Originally Posted by jaslake View Post
    Hi Charles

    Put a Break Point at that Line of Code. Run the Code...the Code will pause at the Line. Open the Immediate Window (View--->Immediate Window).
    In the Immediate Window type----> ?file.type --->Enter.

    What's it say? Change that Line of Code to whatever it says.
    Thanks so much, it is FIXED! Had to change 'Microsoft Office Excel Worksheet' to 'Microsoft Excel Worksheet'.

  13. #13
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Excel 2010 will not run through VBA created 2007

    You're welcome...glad I could help.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ 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. Replies: 4
    Last Post: 11-27-2013, 03:13 PM
  2. Replies: 0
    Last Post: 03-13-2013, 08:25 AM
  3. Will a Macro created in excel 2007 work in the 2010 environment?
    By mprmanzano in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-15-2012, 06:33 AM
  4. [SOLVED] VB Macros and Data Validation created in 2010 Spreadsheet not working in 2007.
    By prgates in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-02-2012, 11:37 AM
  5. I can't get a macro created in 2010 to run in 2007
    By laurareplay in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-16-2012, 07:44 AM

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