Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how use SheetActivate in vba code
im try
https://docs.microsoft.com/en-us/off....sheetactivate Private Sub Workbook_SheetActivate(ByVal Sh As Object) Call unload Call load End Sub but vba call code does not run automatically when entering the sheet activate Sub load() If Application.COMAddIns ("iakun"). Connect = True Then Application.COMAddIns ("iakun"). Connect = False Application.COMAddIns ("iakun"). Connect = True Else Application.COMAddIns ("iakun"). Connect = True End If End Sub deactivate Sub unload () If Application.COMAddIns ("iakun"). Connect = False Then Application.COMAddIns ("iakun"). Connect = True Application.COMAddIns ("iakun"). Connect = False Else Application.COMAddIns ("iakun"). Connect = False End If End Sub something is wrong, with the vba code that I made ? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
how use SheetActivate in vba code
im try
https://docs.microsoft.com/en-us/off....sheetactivate Private Sub Workbook_SheetActivate(ByVal Sh As Object) Call unload Call load End Sub but vba call code does not run automatically when entering the sheet activate Sub load() If Application.COMAddIns ("iakun"). Connect = True Then Application.COMAddIns ("iakun"). Connect = False Application.COMAddIns ("iakun"). Connect = True Else Application.COMAddIns ("iakun"). Connect = True End If End Sub deactivate Sub unload () If Application.COMAddIns ("iakun"). Connect = False Then Application.COMAddIns ("iakun"). Connect = True Application.COMAddIns ("iakun"). Connect = False Else Application.COMAddIns ("iakun"). Connect = False End If End Sub something is wrong, with the vba code that I made ? I suggest you check to see that Application.EnableEvents is turned on: In the Immediate Window type ?Application.EnableEvents and hit Enter return s/b True If not then type Application.EnableEvents=True and hit Enter -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I modify my code to offset the defined range and repeat theprocedure instead of duplicating my code? | Excel Programming | |||
Run VBA code only worksheet change, but don't trigger worksheet_change event based on what the code does | Excel Programming | |||
SheetActivate/DeActivate events in a common module | Excel Programming | |||
SheetActivate | Excel Programming | |||
SheetActivate event | Excel Programming |