Ahh! ! ! I discovered that when I swap my UserForm_Initialize() and
UserForm_Activate() code so that UserForm_Initialize appears first, I see my
calendar. It works great! ! ! Can't explain why the re-order would solve this
problem, but it works.
Thanks again.
Harrry-Wishes.
"Jean-Guy Marcil" wrote:
> "Harry-Wishes" wrote:
>
> > Hello,
> >
> > EllenM and I are working on this project together and perhaps I should
> > provide some clarification.
> >
> > First, thanks for the quick reply.
> >
> > We probably didn't communicate that clearly how the 2 forms interact with
> > one another. The solution you posted works fine if the small form is embedded
> > within the larger form. However, we did not design our project that way. We
> > created 2 separate userforms independent of one another such that, during
> > runtime, the large form appears onscreen containing a button which, when
> > pressed, launches a smaller separate window which happens to be another
> > userform. As you know, all windows be it forms or dialog boxes appear dead
> > center when they first appear onscreen.
> >
> >
> >
> > The reason we mentioned the "StartUpPosition" Property is because I was
> > wondering if you could somehow programmatically bypass what seems to be the
> > only 4 options for positioning dialog boxes on the screeen. To reiterate, I
> > want the smaller window to appear off-center to the larger window. See below.
> > When EllenM and I search VBA help for Word using "StartUpPosition" as the
> > search term, we retrieved the following. Only 4 options appear. Any help
> > appreciated. Thanks again.
> >
> >
> >
> >
> >
> > Manual 0 No initial setting specified.
> >
> > CenterOwner 1 Center on the item to which the UserForm belongs.
> >
> > CenterScreen 2 Center on the whole screen.
> >
> > WindowsDefault 3 Position in upper-left corner of screen.
>
> I did understand your question, at least I think did.
> Again, to achieve what you want, you cannot use the StartUpPosition
> property. You have to use code similar to what I posted.
> I did make a mistake...You have to place that code in the Activate event of
> the userform, not the Initialize one. Here is an example:
>
>
> Private Sub UserForm_Activate()
>
> Dim lngHor As Long
> Dim lngVert As Long
>
> With System
> lngHor = .HorizontalResolution
> lngVert = .VerticalResolution
> End With
>
> Me.Left = (lngHor / 2.5)
> Me.Top = (lngVert / 3)
>
> End Sub
>