Access Denied error when I try ie.document.frames.item(0).document.body.innerhtml

Posted on 2006-06-01
Last Modified: 2008-01-09
I have a VB6 program that monitors an IE window.  It watches for the correct page to be loaded and then checks to see if the user has logged in.

The problem that I am having is I'm getting an error when it runs on some workstations.

The code looks like:

Dim ieDoc As MSHTML.HTMLDocument
Set ieDoc = ie.document  'If I do ieDoc.body.innerHTML here it allways works
Dim ieFrames As MSHTML.FramesCollection
Set ieFrames = ieDoc.frames

Dim mainFrame As MSHTML.HTMLWindow2
Set mainFrame = ieFrames.Item(2)

Dim mainFrameDoc As MSHTML.HTMLDocument
Set mainFrameDoc = mainFrame.document 'on some workstations this doesn't work  I get a  "Access is denied." error.  Number (-2147024891)

tempHTML = mainFrameDoc.body.innerHTML

I've tried to track down what the differences between the workstations that work and the ones that don't, but I haven't found any significant differences yet.

Question by:jsw3nson
    LVL 30

    Expert Comment

    the workstations that have a problem need to have the following

    - correct network share & permissions
    - user logging in needs security & permissions

    Author Comment

    I use the same user on all machines.

    What share and permissions should I check?
    LVL 30

    Expert Comment

    Depending on your app and OS

    NTFS permissions on the folder to at least read
    IIS permissions for the user on the folder to at least access
    LVL 10

    Accepted Solution

    Access denied between frames, usually happens when you try to access one frame from another where both have different domain names, this is a security feature that can be overriden using browser definitions.
    So, you may have different default configuration for IE on the different machines (have a look at the custom security setting options).
    Or maybe somehow on different machines you use differnt domain names - and you only have a problem when they do not match.

    Author Comment

    I don't understand how NTFS or IIS security would matter?  I'm loggin in as the same user on each box.  The user is in the admin group.  I don't know if the web application is running on IIS or not.  I can't modify anything on the server anyway.  The user has full control for NTFS rights.

    I've read about the cross frame security, but why would it work on one machine and not on another?  As far as I can tell the workstations are the same...

    IE version = 6.0.2900.2180.xpsp_sp2_gdr.050301-1519
    vpdate versions:; SP@; 3283;

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit ( and similar technologies have enjoyed wide adoption, making it possib…
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now