Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Entering Debug after delete sheet

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Entering Debug after delete sheet

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Entering Debug after delete sheet

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Entering Debug after delete sheet

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Entering Debug after delete sheet

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Entering Debug after delete sheet

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete sheet on a condition: debug error [email protected] Excel Programming 3 November 13th 07 09:09 PM
UDF Works in Debug Window but not on Sheet? Andibevan Excel Programming 2 September 26th 06 11:42 AM
PLEASE HELP! Copy sheet with password protected cells debug error bsnapool[_6_] Excel Programming 4 July 10th 06 11:58 AM
entering data to overwrite and delete duplicates marshall Excel Discussion (Misc queries) 3 February 22nd 06 11:55 AM
debug message pops up when I select a range of cells and delete Brian Excel Programming 6 October 17th 04 12:55 AM


All times are GMT +1. The time now is 04:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"