WIN32OLE, IE, open an html document..

A

Aldric Giacomoni

Ruby 1.8.6, Windows XP, IE6 and 7:

I think the following code SHOULD open a document but I get an error
instead..
list is the string which is stored into the HTML document (I'm good with
variable naming).

File.open('c:/EmailGroups.html', 'w') { |f| f << list }
ie = WIN32OLE.new('InternetExplorer.Application')
ie.Application.stop
while ie.Busy do
end
ie.Visible = true
while ie.Busy do
end
puts "c:/EmailGroups.html" if File.exist?('EmailGroups.html' )
url = "c:/EmailGroups.html"
ie.Document.URL = url
while ie.Busy do
end
________
And here is the error:
init.rb:116:in `method_missing': (WIN32OLERuntimeError)
OLE error code:80070005 in htmlfile
Access is denied.


HRESULT error code:0x80020009
Exception occurred. from init.rb:116

Line 116 is : ie.Document.URL = url.

Any help .. will be very appreciated :)

Thank you,

--Aldric
 
A

Aldric Giacomoni

Aldric said:
Ruby 1.8.6, Windows XP, IE6 and 7:

I think the following code SHOULD open a document but I get an error
instead..
list is the string which is stored into the HTML document (I'm good
with variable naming).

File.open('c:/EmailGroups.html', 'w') { |f| f << list }
ie = WIN32OLE.new('InternetExplorer.Application')
ie.Application.stop
while ie.Busy do
end
ie.Visible = true
while ie.Busy do
end
puts "c:/EmailGroups.html" if File.exist?('EmailGroups.html' )
url = "c:/EmailGroups.html"
ie.Document.URL = url
while ie.Busy do
end
________
And here is the error:
init.rb:116:in `method_missing': (WIN32OLERuntimeError)
OLE error code:80070005 in htmlfile
Access is denied.


HRESULT error code:0x80020009
Exception occurred. from init.rb:116

Line 116 is : ie.Document.URL = url.

Any help .. will be very appreciated :)

Thank you,

--Aldric
Fixed ... I just did ie.navigate "myurl.html" instead and got rid of all
the 'while busy' loops, which were unneeded.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,192
Latest member
KalaReid2

Latest Threads

Top