启动excel改成启动wps表格
excel.vbs
Dim oShell
Set oShell = CreateObject ("WSCript.shell")
oShell.run "et"
set oShell=nothing
ESFunc.xla
Public es_sShapeName As String '当前选中的图形对象名称
Public Function ESF_newId(ByVal idName As String, _
Optional ByVal whenSave As Boolean = False, _
Optional A1 As String = "") As String
Dim oAdd As Object
Set oAdd = Application.COMAddIns.Item("ESClient.Connect").Object
ESF_newId = oAdd.ESF_newId(idName, whenSave)
End Function
Public Function ESF_MnyToCap(ByVal x As Double) As String
Dim oAdd As Object
Set oAdd = Application.COMAddIns.Item("ESClient.Connect").Object
ESF_MnyToCap = oAdd.ESF_MnyToCap(x)
End Function
Public Function ESF_selectShape(x) As String
If x = "" Then Exit Function
Dim oAdd As Object
Set oAdd = Application.COMAddIns.Item("ESClient.Connect").Object
ESF_selectShape = oAdd.ESF_selectShape(x)
End Function
Public Function ESF_getFldValue( _
ByVal tabName As String, _
ByVal flds As String, _
ParamArray keys()) As Variant
Dim oAdd As Object
Dim sFld As String
Dim i As Integer, n As Integer
If Not IsArray(keys) Then
ESF_getFldValue = ""
Exit Function
End If
n = UBound(keys)
For i = 0 To n
If i = 0 Then
sflds = keys(i)
Else
sflds = sflds & "," & keys(i)
End If
Next
Set oAdd = Application.COMAddIns.Item("ESClient.Connect").Object
ESF_getFldValue = oAdd.ESF_getFldValue(tabName, flds, sflds)
Set oAdd = Nothing
End Function
Public Function ESF_Combine(rng As Range, Optional ByVal split As String = ",") As String
Dim oAdd As Object
Set oAdd = Application.COMAddIns.Item("ESClient.Connect").Object
ESF_Combine = oAdd.ESF_Combine(rng, split)
Set oAdd = Nothing
End Function
Public Sub ESF_SaveReport()
Dim oAdd As Object
Set oAdd = Application.COMAddIns.Item("ESClient.Connect").Object
oAdd.saveCase
Set oAdd = Nothing
End Sub