Macro in add-in not working

drluke

Active Member
Joined
Apr 17, 2014
Messages
314
Office Version
  1. 365
Platform
  1. Windows
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
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
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Upvote 0

Forum statistics

Threads
1,224,833
Messages
6,181,242
Members
453,026
Latest member
cknader

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top