Hi guys
I want some issue
I make a class module with excel application
but...
why this problem???
wrong method use???
Just one time run and "My__App.Class_Application = nothing"
I want some issue
I make a class module with excel application
Code:
I want
module1= dim class as class module
class module=
1) when cell duoubleclick
2) userform.show
3) before form close input a value to cell
4) form close
next time 1-2-3-4...
but...
Code:
1) when cell duoubleclick
2) userform.show
3) before form close input a value to cell
4) form close
at this time action 4 "My__App.Class_Application= nothing"
why this problem???
wrong method use???
Just one time run and "My__App.Class_Application = nothing"
Code:
module_1
Public My__App As New Class_Class
Sub EnableApplication()
Set My__App.Class_Application = Application
End Sub
Sub DisableApplication()
Set My__App = Nothing
End Sub
Public Sub On_TheAction()
DisableApplication
EnableApplication
End Sub
Code:
class module = Class_Class
Option Explicit
Public WithEvents Class_Application As Application
Private Sub Class_Application_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
Dim lng_CodeCol As Long
Dim str_KRW_ETC As String
Dim MyTarget As Range
Dim FN As WorksheetFunction
Set FN = Application.WorksheetFunction
If Target.Columns.Count > 1 Then
GoTo MyExits
ElseIf Target.Rows.Count > 1 Then
GoTo MyExits
ElseIf Target.Cells.Count > 1 Then
GoTo MyExits
Else
End If
If Sh.Name = "param" Then
GoTo MyExits
End If
Call Auto_CodeNumber_List_Make
Set MyTarget = Target.Resize(1, 1)
lng_CodeCol = Cells(1, "P").Column
If Target.Column = lng_CodeCol Or Target.Column = lng_CodeCol + 1 Then
Cancel = True
DoEvents
Form_Select_StudentNames.Show
End If
MyExits:
End Sub