+ Reply to Thread
Results 1 to 7 of 7

Visual Studio Just-In Time Debugger

  1. #1
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Visual Studio Just-In Time Debugger

    I am running some VBA code, and today, I just started having Excel crash on me and getting a message that says
    Visual Studio Just-In Time Debugger
    An unhandled win32 exception occurred in EXCEL.EXE[4140]

    What is causing this, and/or what can I do that will prevent this from happening and my code execute?

  2. #2
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Visual Studio Just-In Time Debugger

    Impossible to say specifically from that information. Do you have Visual Studio installed?
    Good luck.

  3. #3
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546
    Yes visual studio is installed on the machine that produces this error.

  4. #4
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Visual Studio Just-In Time Debugger

    I suspect there is a setting in VS to debug app crashes. Can't say why your code might be causing the app crash though.

  5. #5
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Re: Visual Studio Just-In Time Debugger

    I stepped through the code, and I found it is producing this error when it is trying to copy open a workbook that doesn't exist. Makes sense as to why it would only sporadically produce the error because sometimes the workbook is there whereas others it's not

  6. #6
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Visual Studio Just-In Time Debugger

    Your code really ought to check that before it tries to do anything with the workbook! As an example
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Re: Visual Studio Just-In Time Debugger

    I agree, it needs to! The problem I was running into was the location of the workbooks was constantly changing and since the code is still in the "Testing" phase I never took into account the workbook not existing.

    The problem that I have with checking if the workbook exists is that the Base of the path will be the same, but the workbook could be in one of seven sub-folders that is created by the VBA.

    Please Login or Register  to view this content.
    So in that location there would be subfolders and the workbook it is checking for would be in one of the subfolders. I am trying code a function that would be able to check each sub-folder for the workbook as opposed to having to manually write the code for all 8 workbooks.

+ 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