Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,182
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I modify my code to offset the defined range and repeat theprocedure instead of duplicating my code? [email protected] Excel Programming 4 May 29th 09 10:13 PM
Run VBA code only worksheet change, but don't trigger worksheet_change event based on what the code does ker_01 Excel Programming 6 October 3rd 08 09:45 PM
SheetActivate/DeActivate events in a common module Dileep Chandran Excel Programming 16 August 2nd 07 06:39 AM
SheetActivate Arnaud Excel Programming 2 June 20th 05 05:24 PM
SheetActivate event Andy Palmer Excel Programming 2 April 20th 04 05:20 PM


All times are GMT +1. The time now is 06:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"