-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFunctions.vb
65 lines (41 loc) · 1.57 KB
/
Functions.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Option Strict On
Option Explicit On
Option Compare Text
Imports System.Runtime.InteropServices
<ComVisible(True)>
<Guid(Functions.InterfaceId)>
Public Interface ICLASS_FUNCTIONS
Function IFX() As String
Function TIMENOW() As String
End Interface
<ComVisible(True)>
<Guid(Functions.ClassId)>
<ProgId("AUTOMATION.Functions")>
<ClassInterface(ClassInterfaceType.None)>
<ComDefaultInterface(GetType(ICLASS_FUNCTIONS))>
Public Class Functions
Implements ICLASS_FUNCTIONS
#Region "COM GUIDs"
' These GUIDs provide the COM identity for this class and its COM interfaces.
' If you change them, existing clients will no longer be able to access the class.
Public Const ClassId As String = "df32904d-DEAD-BEEF-9352-5dc0ceafa03e"
Public Const EventsId As String = "ca59b115-DEAD-BEEF-8375-a8f652d3258f"
Public Const InterfaceId As String = "6c409593-DEAD-BEEF-8c16-f3804714e174"
#End Region
' A creatable COM class must have a Public Sub New() with no parameters, otherwise, the
' class will not be registered in the COM registry and cannot be created via CreateObject.
Public Sub New()
MyBase.New()
End Sub
Private Function IFX() As String Implements ICLASS_FUNCTIONS.IFX
Return "AUTO FX OK"
End Function
Private Function TIMENOW() As String Implements ICLASS_FUNCTIONS.TIMENOW
EXCEL.Volatile()
Dim DT As Date
Dim TimeString As String
DT = Now
TimeString = DT.ToLongTimeString() & "." & DT.Millisecond.ToString("D3")
Return TimeString
End Function
End Class