WScript.Echo "About to create an new SharePoint.OpenDocuments.1"
dim obj
set obj = CreateObject("SharePoint.OpenDocuments.1")
WScript.Echo "Finished"
dim obj
set obj = CreateObject("SharePoint.OpenDocuments.1")
WScript.Echo "Finished"
And a VBA:
Public Sub myTest()
Dim spObject As Object
Dim aaa As String
On Error Resume Next
Set spObject = CreateObject("SharePoint.OpenDocuments.1")
If Err.Number <> 0 Then
aaa = "sss"
End If
End Sub
Dim spObject As Object
Dim aaa As String
On Error Resume Next
Set spObject = CreateObject("SharePoint.OpenDocuments.1")
If Err.Number <> 0 Then
aaa = "sss"
End If
End Sub
Notes:
- In VBScript, the try/catch/finally/end try is available. Not in VB/VBA.
- VBA runs in a MS Office App only, while the VBScript is more like JavaScript: can run in the browser or from the command line. Use CScript.exe to run in the latter environment.
- How to output a line to the console in VB/VBA? Don't know.
No comments:
Post a Comment