|  | 
| HitTest Error | 
| Post Reply   | 
| Author | |
| jcollier   Senior Member   Joined: 15 February 2006 Status: Offline Points: 250 |  Post Options  Thanks(0)  Quote  Reply  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! | |
|  | |
| jcollier   Senior Member   Joined: 15 February 2006 Status: Offline Points: 250 |  Post Options  Thanks(0)  Quote  Reply  Posted: 24 July 2006 at 10:15am | 
| 
   Any ideas on this one?
    | |
|  | |
| jcollier   Senior Member   Joined: 15 February 2006 Status: Offline Points: 250 |  Post Options  Thanks(0)  Quote  Reply  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.
    | |
|  | |
| TracyP   Groupie   Joined: 16 February 2006 Status: Offline Points: 22 |  Post Options  Thanks(0)  Quote  Reply  Posted: 26 July 2006 at 10:10am | 
| 
 It could be that your mouse is not over the Calendar when this code is running. Can you call HitTestEx instead? | |
|  | |
| jcollier   Senior Member   Joined: 15 February 2006 Status: Offline Points: 250 |  Post Options  Thanks(0)  Quote  Reply  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.
    | |
|  | |
| TracyP   Groupie   Joined: 16 February 2006 Status: Offline Points: 22 |  Post Options  Thanks(0)  Quote  Reply  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? | |
|  | |
| jcollier   Senior Member   Joined: 15 February 2006 Status: Offline Points: 250 |  Post Options  Thanks(0)  Quote  Reply  Posted: 26 July 2006 at 11:36am | 
| 
   TracyP, That did it! Amazing what a second set of eyes/brains can accomplish. Thanks! | |
|  | |
| Post Reply   | |
| Tweet | 
| Forum Jump | Forum Permissions  You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |