PC Review


Reply
Thread Tools Rate Thread

Debugging suddenly stops...

 
 
darlove
Guest
Posts: n/a
 
      23rd Feb 2007
Hi all. I have a little problem. It will be hard to explain but I'll
try my best. I've been writing some mini-application in VBA in Excel.
One of the bricks is a table that I have to format. When I am
debugging my code, that is I step through it one line at a time, after
some lines the degugger stops suddenly. The yellow line is
disappearing and I can't go any further. I get no message. No error.
Just stops and that's it. This seems to be happening quite at random,
as far as I have noticed. To give you an idea... I have a custom
object that represents the table. It has some methods that enable me
to manipulate the table. When I want to change headers to some
predefined ones that are being held in a defined range on a settings
sheet, the debugger sometimes stops. This is the code:

This is one of the methods of the custom object that
allows me to change the headers in the table.

Public Sub setFinalHeaders()
Dim rOldHeaders As Range
Dim rFinalHeaders As Range
' This variable will hold the headers
' to be transferred to the exported sheet.
Dim vFinalHeaders As Variant
Dim k As Byte
Dim bytHeaderCount As Byte

' Get the range from the settings spreadsheet.
' Remember that the range is spanning the whole row
' so we need to tailor it to the actual number of
' headers.
Set rFinalHeaders = Me.SettingsWsht.Range("final_headers")
' Get the number of adjacent non-empty cells.
bytHeaderCount =
Application.WorksheetFunction.CountA(rFinalHeaders)
' Get the range with non-empty cells (headers).
Set rFinalHeaders =
rFinalHeaders.Resize(ColumnSize:=bytHeaderCount)
' Transfer the headers to a variant array.
vFinalHeaders = rFinalHeaders
' Get the actual headers on the exported spreadsheet.
Set rOldHeaders = Me.Headers

' MARKED FOR THE PURPOSE OF THIS POST. -------------------
' Transfer the final headers to the exported sheet.
rOldHeaders = vFinalHeaders
'
------------------------------------------------------------------------------------------

' Now, indicate that the headers have been changed.
' This line must appear immediately after the previous one.
' TODO When it's all done, change the Visible to False so that
' the name is not visible in any dialog boxes.
Me.TheWorksheet.Names.Add Name:="table_ready", RefersToR1C1:="=1",
Visible:=True

' Clean up.
Set rFinalHeaders = Nothing
Set rOldHeaders = Nothing
End Sub

The problem is that when, when in degbug mode, I get to the line that
I HAVE MARKED the
debugger stops all by itself. I can't proceede any further. I thought
that this could have been
a problem with copying ranges, so I have decided to use another
technique to transfer cells'
texts (using variant arrays) but it does not seem to have solved the
puzzle.

Could anybody give me a hint at where to look for the cause of this
weird debugger's behavior?

Thank you.
Darek

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Debugging suddenly stops... darlove Microsoft Excel Programming 4 27th Feb 2007 12:46 PM
ASP.NET Development Server suddenly stops after debugging vardium Microsoft ASP .NET 0 8th Feb 2006 07:47 AM
Suddenly Debugging Won't Work? Fred Nelson Microsoft VB .NET 14 24th Aug 2004 05:13 PM
ie 6.0- stops responding+debugging also moon Windows XP General 2 24th May 2004 02:49 AM
ie 6.0- stops responding+debugging also moon Windows XP Help 1 24th May 2004 02:49 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:49 PM.