View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
K Warner K Warner is offline
external usenet poster
 
Posts: 3
Default OleObjects add monthview


"Leith Ross" wrote
This will inset a Month View on the
Active Sheet. Making it interactive is another issue.

You are right about making it interactive. I assume there is something I'm
missing.

With MonthView embedded in the WorkSheet, MonthView events are fired as
expected:

Private WithEvents myMonthview As MonthView
Private oleMonthView As OLEObject
Sub whatever()
Set oleMonthView = aSheet.OLEObjects.Item("MonthView1")
Set myMonthview = oleMonthView.Object
end sub

However, when creating a MonthView this way, the MonthView events are not
fired:
(without myMonthview_DateClick event, this is useless)

Private WithEvents myMonthview As MonthView
Private oleMonthView As OLEObject
Sub whatever()
Set oleMonthView = aSheet.OLEObjects.Add _
(ClassType:="MSComCtl2.MonthView")
Set myMonthview = oleMonthView.Object
end sub