A macro in my add-in doesn't work when executing (nothing happens). When I copy the macro to the workbook module (ie not the add-in) then it runs just fine. How do I fix this problem?
The code I'm using is
The code I'm using is
VBA Code:
Sub Worksheet_Change(ByVal Target As Range)
Dim wb As Workbook
Set wb = ActiveWorkbook
ActiveWorkbook.Sheets("Main").Activate
With ActiveSheet
If Not Intersect(Target, Range("D4")) Is Nothing Then
ActiveWorkbook.Sheets("Additions").Visible = True
ActiveWorkbook.Sheets("Additions").Activate
End If
End With
With ActiveSheet
Load frmAdd
frmAdd.Show
End With
End Sub