+ Reply to Thread
Results 1 to 7 of 7

Can't execute code in break mode when opening a workbook

  1. #1
    Forum Contributor
    Join Date
    06-19-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Office365
    Posts
    273

    Can't execute code in break mode when opening a workbook

    Hello, I keep getting this error when running a simple line of code that opens a workbook. What could be the issue?

    here is the line of code, the counterThisMo is a public integer variable

    Please Login or Register  to view this content.

    I don't encounter the error message if I just run it, but when I do a step thru I get this message, it does open the workbook, but the error message pops up right after
    Last edited by lynnsong986; 04-06-2022 at 10:57 AM.

  2. #2
    Forum Contributor GWteB's Avatar
    Join Date
    12-13-2021
    Location
    GMT +1
    MS-Off Ver
    2013
    Posts
    136

    Re: Can't execute code in break mode when opening a workbook

    The only cause I can think of is that in the just opened macro enabled workbook an OnTime macro is being scheduled and invoked right away. In break mode VBA then starts to argue ...
    Did this help? Say thanks by clicking the ★

  3. #3
    Forum Contributor
    Join Date
    06-19-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Office365
    Posts
    273

    Re: Can't execute code in break mode when opening a workbook

    Thanks GWteB, but I don't have any OnTime macro in that workbook

  4. #4
    Forum Contributor GWteB's Avatar
    Join Date
    12-13-2021
    Location
    GMT +1
    MS-Off Ver
    2013
    Posts
    136

    Re: Can't execute code in break mode when opening a workbook

    One way or the other VBA is trying to execute some code, other than the macro you're currently stepping through. Perhaps other forum members do have a clou.

  5. #5
    Forum Contributor
    Join Date
    06-19-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Office365
    Posts
    273

    Re: Can't execute code in break mode when opening a workbook

    I'm a Uipath developer, and I'm getting uipath robot to call macros in excel, but I can't think of anything running automatically in excel. Thanks for your help anyway!

  6. #6
    Forum Contributor GWteB's Avatar
    Join Date
    12-13-2021
    Location
    GMT +1
    MS-Off Ver
    2013
    Posts
    136

    Re: Can't execute code in break mode when opening a workbook

    You are welcome & thanks for posting back.

  7. #7
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Can't execute code in break mode when opening a workbook

    Hi there,

    Just a thought: such an error message would be produced if the workbook being opened contained VBA code which modified the Ribbon configuration for that workbook.

    Regards,

    Greg M

+ 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. Workbook is opening in vba edit mode
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-15-2017, 12:56 PM
  2. executing code in break mode.
    By foxguy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-04-2012, 06:57 PM
  3. Wait for the code to execute before complete opening of excel
    By camaytoc in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-06-2012, 09:59 AM
  4. User form macro opening in break mode
    By LiLi1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-02-2011, 06:49 PM
  5. Execute VB code(for opening xls file) using Java
    By swat@pat in forum Excel General
    Replies: 1
    Last Post: 12-01-2008, 08:38 AM
  6. Can I use VBA to check if the sheet(xxx) is in Page-Break mode or Normal mode ?
    By BaLLZaCH in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2008, 09:03 AM
  7. [SOLVED] opening in break mode?
    By Eric in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-23-2005, 02:06 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