I am disposing my object (trend) on workbook close (see the code).
It returns a compile error "type mismatch" highlighting the "trend".
Trend is defined as:
Public trend As TrendSeg.MainForm
Set trend = New TrendSeg.MainForm
What is wrong here? I used that construction many times, and cannot understand what is wrong in that case.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Cancel = False And Not trend Is Nothing Then
Set trend = Nothing