HitTest Error
Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=4621
Printed Date: 22 November 2024 at 10:04am Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: HitTest Error
Posted By: jcollier
Subject: HitTest Error
Date 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!
|
Replies:
Posted By: jcollier
Date Posted: 24 July 2006 at 10:15am
Posted By: jcollier
Date 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.
|
Posted By: TracyP
Date Posted: 26 July 2006 at 10:10am
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?
|
Posted By: jcollier
Date 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.
|
Posted By: TracyP
Date 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?
|
Posted By: jcollier
Date Posted: 26 July 2006 at 11:36am
TracyP,
That did it! Amazing what a second set of eyes/brains can accomplish. Thanks!
|
|