Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 207
Default 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

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
ActiveX Progress bar initialization in Excel 2003 problem Siroc5 Excel Programming 3 July 8th 05 05:08 AM
UserForm Initialization Patrick Simonds Excel Programming 1 January 21st 05 02:40 AM
Userform Initialization Patrick Simonds Excel Programming 2 May 22nd 04 10:17 PM
ShowDataForm Initialization Alan Excel Programming 2 February 11th 04 11:24 PM
List box initialization Tom Ogilvy Excel Programming 0 July 15th 03 05:41 PM


All times are GMT +1. The time now is 10:44 PM.

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

About Us

"It's about Microsoft Excel"