ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   userform initialization problem (https://www.excelbanter.com/excel-programming/371251-userform-initialization-problem.html)

Ken

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


Dave Peterson

userform initialization problem
 
I don't see anything in the snippet of code you posted that would cause trouble.

If you set a breakpoint inside the _beforerightclick procedure, then maybe you
can step through the code from there.



Ken wrote:

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


--

Dave Peterson

Ken

userform initialization problem
 
Dave, thanks for taking the time to consider my problem.

The problem went away after I installed some Microsoft updates. It
seems a little odd that things worked, then suddenly stopped working
without me doing anything I was aware of, then went away when I did an
update; but, I am glad it is back in order. I need to learn a little
more about breakpoints to help my troubleshooting.

Ken



All times are GMT +1. The time now is 06:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com