Pop up code not working

I

Ian Manning

Hiya,

Wonder if anyone here could help me with a probelm I have getting a
calender control to pop up when a user clicks a cell. I have this
working in a test spreadsheet, but I can't get it to work as part of a
separate SS.

On the test spreadsheet I have used the following code in the worksheet
to pop up the active X control when the user clicks on cell B16:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$B$16" Then
Call OpenCalendar
End If
End Sub

Where OpenCalender is a function defined in the same module that has the
routing:

Sub OpenCalendar()
frmCalender.Show
End Sub

My problem is that although I can get the control to pop up in a test
spreadsheet, once I add it to my main spreadsheet it doesn't work.

Running the OpenCalendar function via the macros menu works fine. It
just doesn't appear when clicking cells.

THanks in advance if anyone can suggest anything.
 
T

Tom Ogilvy

did you export the userform from your test workbook and import it into your
project (or otherwise create it there). Events are enabled in your
project workbook?

Obviously, if the code is working in one location, there wouldn't be much to
comment on concerning the code you show.
 
I

Ian Manning

Tom said:
did you export the userform from your test workbook and import it into your
project (or otherwise create it there). Events are enabled in your
project workbook?

Obviously, if the code is working in one location, there wouldn't be much to
comment on concerning the code you show.
Thanks for replying.

I've tried both ways: exporting and creating it within it.

Using Application.EnableEvents = False I can at least now stop it from
working in my test workbook, however there is no =False statement in my
project. Is there anywhere else this setting can be found?
 
I

Ian Manning

Ian said:
Thanks for replying.

I've tried both ways: exporting and creating it within it.

Using Application.EnableEvents = False I can at least now stop it from
working in my test workbook, however there is no =False statement in my
project. Is there anywhere else this setting can be found?

Ahhh, I've worked out what is causing it: the cell referenced is
actually a merged cell....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top