I thought this was impossible, but someone suggested
it might be possible.
Thanks for any info...
Cheers,
Hal
By default, most/all of the WMI methods work on a local instance,
unless given a \\remotecomputer name.
Of course, this is also assuming you have the right privileges (i.e.,
domain administrator).
-Corey
--- rubyh...@gmail.com wrote:
> I'm rying to figure out whether it's possible to
> talk to the COM interface of a program running
> on a remote machine.
>
> I thought this was impossible, but someone suggested
> it might be possible.
I believe it is possible by virtue of DCOM (Distributed COM). I have never used it before but here
is a good starting point:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndcom/html/msdn_dcomhb.asp
> Thanks for any info...
>
>
> Cheers,
> Hal
-- shanko
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
It sounds like my first impulse might well be the easiest one --
to wrap a COM server with Ruby and then share it remotely
using drb.
To talk to a local COM-aware app, there's no reason Win32OLE
shouldn;t suffice, is there? Ralph Mason had a thing called
RubyCOM -- I used to know the difference, but I've forgotten.
Cheers,
Hal
"Hello! Can you help me?"
http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/ruby/ruby-talk/36595?36502-38858+split-mode-vertical
?
daz
> It sounds like my first impulse might well be the easiest one --
> to wrap a COM server with Ruby and then share it remotely
> using drb.
Correct ... that would be my impulse too :-)
> To talk to a local COM-aware app, there's no reason Win32OLE
> shouldn;t suffice, is there?
Depends on the app ... rather the documentation (or the lack thereof) that comes with it.
But yes, in general there is no reason that Win32OLE shouldn't suffice.
Which COM aware app(s) are we talking of here?
-- shanko
____________________________________________________
Sell on Yahoo! Auctions – no fees. Bid on great items.
http://auctions.yahoo.com/
Sorry, I missed your post.
--- daz <do...@d10.karoo.co.uk> wrote:
>
> "Hello! Can you help me?"
>
http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/ruby/ruby-talk/36595?36502-38858+split-mode-vertical
>
I have tried the trick mentioned in that post but could not get it to work.
Here is the segment I tried:
#####################
require 'win32ole'
excel = WIN32OLE.new("excel.application",'localhost') # 'wsdev01')
excel['Visible'] = true
spreadsheet = excel.Workbooks.Open("C:\\junk.xls")
sheet = spreadsheet.Worksheets(1).Range("D1")
excel.Columns("A:A").select
excel.Sheets(1).Range("D1")
excel.Selection.Font.Name = "Arial"
excel.Selection.Font.FontStyle = "Normal"
excel.Selection.Font.Size = 14
excel.DisplayAlerts = false
excel.ActiveWorkbook.Save
excel.Workbooks.Close
excel.DisplayAlerts = true
#############################################
When I ran it with 'localhost' it ran fine. But when I changed it to
'wsdev01' which is a machine on the network which my machine can see
and has Excel installed on it, the script error'd out saying:
C:/atest/tst_excel.rb:6:in `initialize': Failed to create DCOM server `excel.application' in
`wsdev01' (WIN32OLERuntimeError)
HRESULT error code:0x80070005
Access is denied. from C:/atest/tst_excel.rb:6:in `new'
from C:/atest/tst_excel.rb:6
Any hints as to what I could be doing wrong?
Thanks,
--- Shashank Date <shank...@yahoo.com> wrote:
>
> I have tried the trick mentioned in that post but could not get it to work.
>
Ok, I take that back. I found this KB article on
http://support.microsoft.com/kb/q158582/
and when I set up the client and the server properly using DCOMCNFG.exe, I was able to run the
script (without the Save).