Closed Thread
Results 1 to 12 of 12

Excel 2007 : No return() or halt() function message in Excel2007

  1. #1
    Registered User
    Join Date
    12-22-2010
    Location
    BP,HUN
    MS-Off Ver
    Excel 2007
    Posts
    9

    No return() or halt() function message in Excel2007

    Dear All,

    i’m programming a commercial software in matlab environment. The link between this software and matlab is EXCEL. The software can be navigated through Excel therefore all I’m trying to do is creating a dynamic data exchange between Matlab and Excel active (running) worksheet and run the excelmacro of the other commercial software. If I run this macro directly from excel (MenuRunAnalysis) it causes no trouble however if I run it via matlab I get the message:
    ’No RETURN() or HALT() function found on macro sheet.”
    I checked the message and found that it was a bug of previous Excel versions like Excel2000. Originally I used 2003 with SP3 but upgraded to 2007 SP2 to avoid this message, without any effect. Actually the code works fine it does all I need but after every single iteration I get this warning so the matlab code cannot do a whole loop because I always have to intervene and clilck OK.
    The VBA code I’m using is:

    Please Login or Register  to view this content.
    I’m having this problem for several weeks now and running out of ideas. I would really appreciate if someone could help me to come over this obstacle.
    Last edited by DonkeyOte; 12-22-2010 at 05:32 AM. Reason: added tags

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: No return() or halt() function message in Excel2007

    Are you using an XLM macro? If so, is there a RETURN() statement in it?
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    12-22-2010
    Location
    BP,HUN
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: No return() or halt() function message in Excel2007

    Quote Originally Posted by romperstomper View Post
    Are you using an XLM macro? If so, is there a RETURN() statement in it?
    XLM macro? I’m not really familiar with VBA. I just recorded the macro while starting the other software’s macro and the entire code can be found above. (I did not write return or any other command, just tried to switch off the alert massage)

    did I miss something?

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: No return() or halt() function message in Excel2007

    What is MenuRunAnalysis?

  5. #5
    Registered User
    Join Date
    12-22-2010
    Location
    BP,HUN
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: No return() or halt() function message in Excel2007

    Quote Originally Posted by romperstomper View Post
    What is MenuRunAnalysis?
    MenuRunAnalysis is a macro created automatically by the commercial software (GC). If I would like to control GC via excel, I give in or change the parameters of the GC model stored in excel cells and with MenuRunAnalysis macro I can run the calculations. I do not have to open GC because the macro runs the simulation behind excel and returns with the output data.

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: No return() or halt() function message in Excel2007

    Well it would appear that the issue is not with Excel itself, but with Matlab or GC, or the combination of the two (or three). Since I don't have either of the other two programs, I'm afraid I will have to bow out, but you might want to try their support if you haven't already.

  7. #7
    Registered User
    Join Date
    12-22-2010
    Location
    BP,HUN
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: No return() or halt() function message in Excel2007

    Quote Originally Posted by romperstomper View Post
    Well it would appear that the issue is not with Excel itself, but with Matlab or GC, or the combination of the two (or three). Since I don't have either of the other two programs, I'm afraid I will have to bow out, but you might want to try their support if you haven't already.
    I can run excel macros via matlab with no effort. So the connection between this two should be fine. Also I can control GC via excel as well. The problem I’m having (this warning with return() and halt()) occurs just when I try to combine all three. Do you have any idea or tip what I can do (write into the VBA code) to disable this message?

    Otherwise Thanx for bothering with my problem

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: No return() or halt() function message in Excel2007

    I don't think there is anything you can put in the code.
    Do you by any chance have multiple instances of Excel running when you do this?

  9. #9
    Registered User
    Join Date
    12-22-2010
    Location
    BP,HUN
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: No return() or halt() function message in Excel2007

    Quote Originally Posted by romperstomper View Post
    I don't think there is anything you can put in the code.
    Do you by any chance have multiple instances of Excel running when you do this?
    I guess so. I switched on ’share workbook’ and saved the sheet on a different name. Do I need anything else?

  10. #10
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: No return() or halt() function message in Excel2007

    Why have you shared the workbook? Shared Workbooks should be avoided if at all possible.

  11. #11
    Registered User
    Join Date
    12-22-2010
    Location
    BP,HUN
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: No return() or halt() function message in Excel2007

    Quote Originally Posted by romperstomper View Post
    Why have you shared the workbook? Shared Workbooks should be avoided if at all possible.
    Sorry I just misunderstood you. I have just one worksheet open. I tried to share the workbook, because I could not come over this problem and thought if GC runs macro in the same worksheet Matlab does, it might helps if I share the workbook however it didn’t go either way.

  12. #12
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: No return() or halt() function message in Excel2007

    Continued here.

Closed 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