Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a macro where it's tasks is to delete a WS and copy a replacement from
another WB. When single stepping through the code, after the Sheets("Lists").delete, VBA will no longer allow me to enter the debug mode. I get the message "Can't enter debug mode at this time." Any ideas why this occurs? And how to I enter debug in this code? (other than debug.print) In order for the rest of the code to operate correctly, the sheet must be deleted. Thanks, John |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've never seen this occur after deleting a sheet.
But I have seen a similar message appear "Can't enter break mode at this time" when I'm adding a control from the Control toolbox toolbar to a worksheet. I can't step through that line (always????). So I set a break point right before and after and just run to the next step. It's almost the same. (Are you sure it's "debug mode" in the warning message???) DocBrown wrote: I have a macro where it's tasks is to delete a WS and copy a replacement from another WB. When single stepping through the code, after the Sheets("Lists").delete, VBA will no longer allow me to enter the debug mode. I get the message "Can't enter debug mode at this time." Any ideas why this occurs? And how to I enter debug in this code? (other than debug.print) In order for the rest of the code to operate correctly, the sheet must be deleted. Thanks, John -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You are correct, it is '... break mode ...'
Break points encounter the same message. The only enabled options buttons are Continue or End. The code in question is: prevValue = Application.DisplayAlerts Application.DisplayAlerts = False On Error Resume Next Sheets.Item("Lists").Delete On Error GoTo ErrThisSub Application.DisplayAlerts = prevValue The sheet is deleted as expected. I'm trying to debug a problem that occurs after this point in the code. John S "Dave Peterson" wrote: I've never seen this occur after deleting a sheet. But I have seen a similar message appear "Can't enter break mode at this time" when I'm adding a control from the Control toolbox toolbar to a worksheet. I can't step through that line (always????). So I set a break point right before and after and just run to the next step. It's almost the same. (Are you sure it's "debug mode" in the warning message???) DocBrown wrote: I have a macro where it's tasks is to delete a WS and copy a replacement from another WB. When single stepping through the code, after the Sheets("Lists").delete, VBA will no longer allow me to enter the debug mode. I get the message "Can't enter debug mode at this time." Any ideas why this occurs? And how to I enter debug in this code? (other than debug.print) In order for the rest of the code to operate correctly, the sheet must be deleted. Thanks, John -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try putting a break point before the offending line. And another after the
offending line. Then don't step through the code after you hit that first break point--Run it. DocBrown wrote: You are correct, it is '... break mode ...' Break points encounter the same message. The only enabled options buttons are Continue or End. The code in question is: prevValue = Application.DisplayAlerts Application.DisplayAlerts = False On Error Resume Next Sheets.Item("Lists").Delete On Error GoTo ErrThisSub Application.DisplayAlerts = prevValue The sheet is deleted as expected. I'm trying to debug a problem that occurs after this point in the code. John S "Dave Peterson" wrote: I've never seen this occur after deleting a sheet. But I have seen a similar message appear "Can't enter break mode at this time" when I'm adding a control from the Control toolbox toolbar to a worksheet. I can't step through that line (always????). So I set a break point right before and after and just run to the next step. It's almost the same. (Are you sure it's "debug mode" in the warning message???) DocBrown wrote: I have a macro where it's tasks is to delete a WS and copy a replacement from another WB. When single stepping through the code, after the Sheets("Lists").delete, VBA will no longer allow me to enter the debug mode. I get the message "Can't enter debug mode at this time." Any ideas why this occurs? And how to I enter debug in this code? (other than debug.print) In order for the rest of the code to operate correctly, the sheet must be deleted. Thanks, John -- Dave Peterson -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Did that. VBA recognizes the break point but displays that message. Can't
enter break mode at this time. prevValue = Application.DisplayAlerts Application.DisplayAlerts = False On Error Resume Next <-- BreakPoint, stops here. Sheets.Item("Lists").Delete On Error GoTo ErrThisSub <-- BreakPoint. Message displayed? Application.DisplayAlerts = prevValue I hit continue, and my code encounters another failure I'm trying to locate the source of the failure. The error I encounter Error 70' Permission Denied.' And VBA will not allow entry into debug/break mode. John "Dave Peterson" wrote: Try putting a break point before the offending line. And another after the offending line. Then don't step through the code after you hit that first break point--Run it. DocBrown wrote: You are correct, it is '... break mode ...' Break points encounter the same message. The only enabled options buttons are Continue or End. The code in question is: prevValue = Application.DisplayAlerts Application.DisplayAlerts = False On Error Resume Next Sheets.Item("Lists").Delete On Error GoTo ErrThisSub Application.DisplayAlerts = prevValue The sheet is deleted as expected. I'm trying to debug a problem that occurs after this point in the code. John S "Dave Peterson" wrote: I've never seen this occur after deleting a sheet. But I have seen a similar message appear "Can't enter break mode at this time" when I'm adding a control from the Control toolbox toolbar to a worksheet. I can't step through that line (always????). So I set a break point right before and after and just run to the next step. It's almost the same. (Are you sure it's "debug mode" in the warning message???) DocBrown wrote: I have a macro where it's tasks is to delete a WS and copy a replacement from another WB. When single stepping through the code, after the Sheets("Lists").delete, VBA will no longer allow me to enter the debug mode. I get the message "Can't enter debug mode at this time." Any ideas why this occurs? And how to I enter debug in this code? (other than debug.print) In order for the rest of the code to operate correctly, the sheet must be deleted. Thanks, John -- Dave Peterson -- Dave Peterson |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I got the same error that you got.
But this syntax worked fine (even stepping through the code): Sheets("Lists").Delete And then I tested your syntax again and it worked fine--with or without the Lists sheet existing. So I closed excel, reopened excel, and started testing both versions. I couldn't break either. I don't have a guess. Have you closed excel and reopened??? DocBrown wrote: Did that. VBA recognizes the break point but displays that message. Can't enter break mode at this time. prevValue = Application.DisplayAlerts Application.DisplayAlerts = False On Error Resume Next <-- BreakPoint, stops here. Sheets.Item("Lists").Delete On Error GoTo ErrThisSub <-- BreakPoint. Message displayed? Application.DisplayAlerts = prevValue I hit continue, and my code encounters another failure I'm trying to locate the source of the failure. The error I encounter Error 70' Permission Denied.' And VBA will not allow entry into debug/break mode. John "Dave Peterson" wrote: Try putting a break point before the offending line. And another after the offending line. Then don't step through the code after you hit that first break point--Run it. DocBrown wrote: You are correct, it is '... break mode ...' Break points encounter the same message. The only enabled options buttons are Continue or End. The code in question is: prevValue = Application.DisplayAlerts Application.DisplayAlerts = False On Error Resume Next Sheets.Item("Lists").Delete On Error GoTo ErrThisSub Application.DisplayAlerts = prevValue The sheet is deleted as expected. I'm trying to debug a problem that occurs after this point in the code. John S "Dave Peterson" wrote: I've never seen this occur after deleting a sheet. But I have seen a similar message appear "Can't enter break mode at this time" when I'm adding a control from the Control toolbox toolbar to a worksheet. I can't step through that line (always????). So I set a break point right before and after and just run to the next step. It's almost the same. (Are you sure it's "debug mode" in the warning message???) DocBrown wrote: I have a macro where it's tasks is to delete a WS and copy a replacement from another WB. When single stepping through the code, after the Sheets("Lists").delete, VBA will no longer allow me to enter the debug mode. I get the message "Can't enter debug mode at this time." Any ideas why this occurs? And how to I enter debug in this code? (other than debug.print) In order for the rest of the code to operate correctly, the sheet must be deleted. Thanks, John -- Dave Peterson -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete sheet on a condition: debug error | Excel Programming | |||
UDF Works in Debug Window but not on Sheet? | Excel Programming | |||
PLEASE HELP! Copy sheet with password protected cells debug error | Excel Programming | |||
entering data to overwrite and delete duplicates | Excel Discussion (Misc queries) | |||
debug message pops up when I select a range of cells and delete | Excel Programming |