+ Reply to Thread
Results 1 to 4 of 4

Problem Single-Stepping Through workbooks.open

  1. #1
    Registered User
    Join Date
    01-11-2012
    Location
    Boston Area, MA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Problem Single-Stepping Through workbooks.open

    I'm running Excel 2010 32 bit (on 64-bit Windows 7) and am experiencing some odd behavior in VBA with the debugger. When I try to single step through the following line of code:
    Set OpenExternalWorkbook = Workbooks.Open(Filename:=strWorkbookName, ReadOnly:=ReadOnly)
    the workbook identified by strWorkbookName is opened briefly and then closes. Execution of the calling function is halted. If I run through this line of code, even if the very next line of code is a "stop" command, everything runs just fine. Has anyone seen behavior like this before?

    Just to be clear, there are no autorun event handlers in strWorkbookName.

    Any help would be greatly appreciated.

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Problem Single-Stepping Through workbooks.open

    I have had the same issues with the debugger. The way I get around this is to use the breakpoints tool, then debug anywhere after any code that calls for another workbook.
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Registered User
    Join Date
    01-11-2012
    Location
    Boston Area, MA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Problem Single-Stepping Through workbooks.open

    Well, I'm glad to learn that I'm not crazy. It sure seemed weird.

    I had slightly different, but equally bizarre behavior in another workbook. In this other workbook, when I single-stepped through the workbooks.open command, it ran the entire macro without stopping, even though it should have stopped at the next line of code.

  4. #4
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Problem Single-Stepping Through workbooks.open

    I have had that happen too.

+ 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