5 Replies - 887 Views - Last Post: 09 July 2013 - 08:48 AM Rate Topic: -----

#1 Criel  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 128
  • Joined: 11-March 11

Access is denied webbrowser clicking textarea

Posted 26 June 2013 - 09:12 AM

I"m just creating a small application to use the web browser for a little practice and came across this error when trying to enter a textbox on a website. I'm just trying to understand why I'm not able to click the textarea and would just like some information on why i'm getting an access is denied error and where it's getting denied from - is it getting denied from the website itself or visual studio?

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
For j = 0 To WebBrowser1.document.Domdocument.all.length - 1
    HTMLElementMain = WebBrowser1.document.Domdocument.all.item(j)
    If HTMLElementMain.TagName <> Nothing Then
        If StrComp(HTMLElementMain.tagName, "textarea", CompareMethod.Text) = 0 Then
            MessageBox.Show("found the text box", "Found", MessageBoxButtons.OK, MessageBoxIcon.Hand)
            HTMLElementMain.Click() 'Here's where it throws the error
            Exit Sub

            'HTMLElement.click()
            WebBrowser1.document.All("comment").SetAttribute("Value", "This is a test")
            Exit For
        End If
    End If
Next


Is This A Good Question/Topic? 0
  • +

Replies To: Access is denied webbrowser clicking textarea

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9487
  • View blog
  • Posts: 35,772
  • Joined: 12-June 08

Re: Access is denied webbrowser clicking textarea

Posted 26 June 2013 - 09:16 AM

What is the full error?
Was This Post Helpful? 0
  • +
  • -

#3 Criel  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 128
  • Joined: 11-March 11

Re: Access is denied webbrowser clicking textarea

Posted 26 June 2013 - 09:20 AM

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

This is the exception I am getting
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9487
  • View blog
  • Posts: 35,772
  • Joined: 12-June 08

Re: Access is denied webbrowser clicking textarea

Posted 26 June 2013 - 09:26 AM

Okay.. so that's all of it? Nothing more? When you put a break point at the top of that code and step through it, what line is it happening on?
Was This Post Helpful? 0
  • +
  • -

#5 Criel  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 128
  • Joined: 11-March 11

Re: Access is denied webbrowser clicking textarea

Posted 09 July 2013 - 07:33 AM

Sorry for the late reply.

Here's the trace of the error to help better understand my issue :)/> The error is occuring on the line
HTMLElementMain.Click()
. There may be a better way to go about this, but it's worked for me in the past so I'm not entirely sure if this way even works with any textbox out there.

System.UnauthorizedAccessException was unhandled
  Message="Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"
  Source="mscorlib"
  StackTrace:
       at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
       at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
       at Microsoft.VisualBasic.CompilerServices.VBBinder.InvokeMember(String name, BindingFlags invokeAttr, Type objType, IReflect objIReflect, Object target, Object[] args, String[] namedParameters)
       at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)
       at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)
       at YTAA.YTAA.btnBegin_Click(Object sender, EventArgs e) in xxxxxxxxxxxxxx
       at System.Windows.Forms.Control.onclick(EventArgs e)
       at System.Windows.Forms.Button.onclick(EventArgs e)
       at System.Windows.Forms.Button.onmouseup(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)
       at System.Windows.Forms.Nativewindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(ApplicationContext context)
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at YTAA.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:

Was This Post Helpful? 0
  • +
  • -

#6 lar3ry  Icon User is offline

  • Coding Geezer
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,290
  • Joined: 12-September 12

Re: Access is denied webbrowser clicking textarea

Posted 09 July 2013 - 08:48 AM

If the web page is not prorietary or otherwise private, could you show us the URL?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1