Advertisement
Guest User

Untitled

a guest
Feb 25th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. Set CreateObject = VBA.CreateObject(Class$, ServerName$)
  2.  
  3. Function CreateObject(className, serverName)
  4. '---- override the CreateObject
  5. ' function in order to register what
  6. ' object is being created in any error message
  7. ' that's generated
  8. Dim source, descr, errNum
  9.  
  10. WScript.echo "In custom CreateObject"
  11. If Len(serverName) > 0 Then
  12. Set CreateObject = WScript.CreateObject(className, serverName)
  13. Else
  14. Set CreateObject = WScript.CreateObject(className)
  15. End If
  16.  
  17. End Function
  18.  
  19. Dim fso
  20. Set fso = CreateObject("Scripting.FileSystemObject", "")
  21. path = fso.GetAbsolutePathName(".")
  22.  
  23. WScript.echo path
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement