Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - HitTest Error
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

HitTest Error

 Post Reply Post Reply
Author
Message
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post Topic: HitTest Error
    Posted: 19 July 2006 at 5:12pm
Can someone tell me why the following code would tell me that the Object or With Block Variable Not Set.  Runtime 91.

I have verified that an event is selected, HitTest is not nothing and the code is located in a CommandBars_Execute event.

Dim HitTest As CalendarHitTestInfo
Set HitTest = Calendar.ActiveView.HitTest
   
Dim CurrentEvent As CalendarEvent
Set CurrentEvent = HitTest.ViewEvent.Event

Thanks!
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2006 at 10:15am
Any ideas on this one?
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post Posted: 26 July 2006 at 9:53am
Do I need to provide more info to get this looked at?  Just let me know what you need and I'll do my best to get it.
Back to Top
TracyP View Drop Down
Groupie
Groupie


Joined: 16 February 2006
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote TracyP Quote  Post ReplyReply Direct Link To This Post Posted: 26 July 2006 at 10:10am
Originally posted by jcollier jcollier wrote:

Can someone tell me why the following code would tell me that the Object or With Block Variable Not Set.  Runtime 91.

I have verified that an event is selected, HitTest is not nothing and the code is located in a CommandBars_Execute event.

Dim HitTest As CalendarHitTestInfo
Set HitTest = Calendar.ActiveView.HitTest
   
Dim CurrentEvent As CalendarEvent
Set CurrentEvent = HitTest.ViewEvent.Event

Thanks!


It could be that your mouse is not over the Calendar when this code is running. Can you call HitTestEx instead?
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post Posted: 26 July 2006 at 10:28am
The mouse is definitely over the calendar.  When I right click a day, I have a CJ Popup menu with 1 menu item.  The error occurs in the execute event of the commandbar object when I click the menu item.  In all cases, the menu item is directly over the day I right clicked on the calendar.
Back to Top
TracyP View Drop Down
Groupie
Groupie


Joined: 16 February 2006
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote TracyP Quote  Post ReplyReply Direct Link To This Post Posted: 26 July 2006 at 10:35am
Perhaps the commandbar over the calendar is in the way.

Can you call HitTest before the popup for the commandbar code to use?
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post Posted: 26 July 2006 at 11:36am
TracyP,

That did it!  Amazing what a second set of eyes/brains can accomplish.  Thanks!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.