View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 207
Default userform initialization problem

I have a workbook with a worksheet that contains the following
beforerightclick code:

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
Cancel = True
SummaryForm.Show
End Sub

The userform, SummaryForm, has a lot of code, and ends with:

Private Sub UserForm_Initialize()

Dim i As Integer
Dim j As Integer
..
..
..
MultiPage1.Value = 0

MsgBox "end of userform initialize code"

End Sub

When I right click on the sheet, I get the "end of userform initialize
code" (which I added as a test), the userform appears, then I
immediately get taken to the debug mode on the "SummaryForm.Show" line.
I don't even get the usual offer of "Debug or Cancel". Also, at that
point I can not use F8 to step through the code. It is basically
frozen until I break out. The code is in a file that is used as a
template. I have lots of files, none of them had the problem before,
and now they all have the same symptoms, so I don't think it is a data
problem since the files are all self contained with no external links.

Does anyone have any ideas?

Thanks

Ken