View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default user form infinit loop

I think you need to step through the code to determine what is happening.

click on the line Range("c" & seriaL).Value = ndtcontratO

then Press F9 to set a break point. Start the code the way you would
normally do and the macro should stop on the line with the break point. Then
type F8 to step through code. You can add more break points and use F5 to
run until next break or until the end. I can't see from the code provided
what is causing the inifinite loop.

"Paulo" wrote:

didnt work,

Private Sub CmdEditar_Click()
Application.EnableEvents = False
... code...
Range("c" & seriaL).Value = ndtcontratO
(here is when the programs calls CmbEmpresa_Change) and output's Infinit loop
... code...
Unload Me
Application.EnableEvents = True
Exit Sub
trataErro:
MsgBox Error & " " & Err
End Sub


"Joel" wrote:

Turn of events at beginning to code and turn them back on at the end

Application.EnableEvents = False

Application.EnableEvents = True

"Paulo" wrote:

hi,

I am designing a Data base.
for feeling it out, I am designing a Userform.
my userform, have a Combobox that by been selected, feels in couple
txtboxes with data from the worksheet.
when I am done, editing the textboxes, I have the button Edit, that will
paste the new values on the worksheet.
My problem is, when I edit, the combobox_change code runs and i get myself
into a infinit loop. is therea way to tel the code not to go there on change?