实际上,我用的是我自己的DLL!
Const Lib = """IFCSW67.dll"""
Sub Auto_open()
Register "Fun1", 3, "Numerator,Divisor", 1, "Division", _
"Divides two numbers", """Numerator"",""Divisor """, "F1"
Register "Fun2", 3, "Number1,Number2", 1, "Multiplication", _
"Multiplies two numbers", """First number"",""Second number """, _
"F2"
Register "Fun3", 3, "Numerator,Divisor", 1, "Division", _
"Divides two numbers", """Numerator"",""Divisor """, "F3"
Register "Fun4", 3, "Number1,Number2", 1, "Multiplication", _
"Multiplies two numbers", """First number"",""Second number """, _
"F4"
Register "Fun5", 3, "Numerator,Divisor", 1, "Division", _
"Divides two numbers", """Numerator"",""Divisor """, "F5"
Register "Fun6", 3, "Number1,Number2", 1, "Multiplication", _
"Multiplies two numbers", """First number"",""Second number """, _
"F6"
Register "Fun7", 3, "Numerator,Divisor", 1, "Division", _
"Divides two numbers", """Numerator"",""Divisor """, "F7"
End Sub
Sub Auto_close()
Dim FName, FLib
Dim I As Integer
FName = Array("Fun1", "Fun2", "Fun3", "Fun4", "Fun5", "Fun6", "Fun7")
FLib = Array("F1", "F2", "F3", "F4", "F5", "F6", "F7")
For I = 1 To 7
With Application
.ExecuteExcel4Macro "UNREGISTER(" & FName(I) & ")"
.ExecuteExcel4Macro "REGISTER(" & Lib & _
",""CharPrevA"",""P"",""" & FName(I) & """,,0)"
.ExecuteExcel4Macro "UNREGISTER(" & FName(I) & ")"
End With
Next
End Sub |