hi,
i am facing strange behaving of my application.

i have developed one simple application, which will fill up some fields in webbrowser control webpage. this webpage has iframes in it. domain of both iframe are same and fields which i am filling with my code is in iframe.

but when i run program and execute code to fill fields of iframr webpage.
i am getting following access denied error..

http://img683.imageshack.us/img683/808/37514033.jpg

then i write same code in vb.net application, its filling all fields of iframe perfectly.

so i think some setting is problem with vb6.

can anyone help me out. i am searching solution since last 4 days.
please.

Recommended Answers

All 4 Replies

Have no idea why without seeing code but I can help you out in how to figure it out for yourself.

First, make sure Option Explicit is at the top of each code window.
2nd, place proper error handling in each and every sub, which means getting rid of any on error resume next statements...

Good Luck

Have no idea why without seeing code but I can help you out in how to figure it out for yourself.

First, make sure Option Explicit is at the top of each code window.
2nd, place proper error handling in each and every sub, which means getting rid of any on error resume next statements...

Good Luck

here is code.
Dim doc As HTMLDocument
Dim doc2 As HTMLDocument
Set doc = WebBrowser1.document
Dim f As MSHTML.HTMLFrameElement
Set doc2 = doc.frames.Item(0).document

error occur when i try to assign document to doc2.

nothing much in code.

Set a break point on the line above, run, when the program breaks, activate the locals window. Now, with the locals window activated, find the control (not your doc reference to the document contained within the control) and drill down to the document level (what your doc variable is set against). Then drill down on that to see if you have access to each iframe (look at their index numbers because I'll almost bet index starts at 1 (going from memory here)). Now with that drilled down to, can you see any further properties? If so, good. If not, then you may need another variable or two to set to each document contained within the frame...

Okay, drill down on the doc variable and see if you have the same information and once again look for the index number...

Good Luck

Set a break point on the line above, run, when the program breaks, activate the locals window. Now, with the locals window activated, find the control (not your doc reference to the document contained within the control) and drill down to the document level (what your doc variable is set against). Then drill down on that to see if you have access to each iframe (look at their index numbers because I'll almost bet index starts at 1 (going from memory here)). Now with that drilled down to, can you see any further properties? If so, good. If not, then you may need another variable or two to set to each document contained within the frame...

Okay, drill down on the doc variable and see if you have the same information and once again look for the index number...

Good Luck

wow,
you are not expert , you are master expert.
i followed your instructions spend some time in watch window, gone though all attribute and then found index starts with 1.

i place 1 in place of 0 and its solved.

thank you so much, thanks for guiding me. really appreciate your help sir.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.