Guest User

Untitled

a guest
Jun 21st, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. require 'win32ole'
  2.  
  3. conn = WIN32OLE.new("Excel.Application")
  4.  
  5. def inspect_method(ole_method)
  6. puts "*" * 20
  7. puts "ole method: " + ole_method.name
  8. puts ole_method.invoke_kind + " returns " + ole_method.return_type_detail.join(", ")
  9.  
  10. args = "takes #{ole_method.size_params} args"
  11. if ole_method.size_opt_params > 0
  12. args << " of which #{ole_method.size_opt_params} are optional"
  13. end
  14. puts args
  15.  
  16. puts "named parameters: " + ole_method.params.inspect unless ole_method.params.empty?
  17. puts "not visible!" if !ole_method.visible?
  18. end
  19.  
  20. methods = conn.ole_methods
  21. methods = methods.sort {|a, b| a.name <=> b.name }
  22.  
  23. methods.map {|m| inspect_method(m)}
  24.  
  25. # Uncomment this to see what else is out there!
  26. # puts (methods.last.methods - Object.new.methods).sort
Add Comment
Please, Sign In to add comment