Run Time Error 438 - Object doesn't support this property or method

programsam

Board Regular
Joined
Feb 10, 2016
Messages
123
Alrighty folks, got another error on the following code. The code executes all the way down to the iframe coding.

I'm trying to fill out a webform that's nested in an IE frame and it's throwing a run time error when it gets to the With statement. Still learning so any assistance is much appreciated.

Here's what I have so far.

Code:
Option Explicit

Sub fillForm()


'Establish IE
Dim IE As InternetExplorer
Set IE = New InternetExplorerMedium


'because of security settings, you must reset IE settings


'Change Settings


Dim activeLink As String


activeLink = "link"


'Open IE and Naviage to SAP form
With IE


    .navigate activeLink
    .Visible = True


   'Loop to wait until page loads
   
Do While .Busy Or .readyState <> READYSTATE_COMPLETE
DoEvents
Loop


End With


'Find IE Form


Dim iframeDoc As MSHTML.HTMLDocument
Set iframeDoc = IE.document


'Fill out Form


Dim cT As String


cT = ThisWorkbook.Sheets("data").Range("P2").Value




With iframeDoc


    iframeDoc.getElementById("contentAreaFrame").contentWindow.iframeDoc.getElementById("isolatedWorkArea").contentWindow.getElementById("__xmlview1--idInputCT-inner").Value = cT


'Submit Form
    iframeDoc.getElementsById("__xmlview1--idFilterbar-btnGo").Value.Click


End With




'Call macro to pull results








End Sub
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Not tested, but try changing

these 2 lines
'
Code:
Establish IE
Dim IE As InternetExplorer
Set IE = New InternetExplorerMedium


to


Code:
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
 
Upvote 0
Gah, is there another workaround? This accesses an intranet so InternetExplorerMedium is necessary.

Not tested, but try changing

these 2 lines
'
Code:
Establish IE
Dim IE As InternetExplorer
Set IE = New InternetExplorerMedium


to


Code:
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
 
Upvote 0

Forum statistics

Threads
1,214,611
Messages
6,120,509
Members
448,967
Latest member
screechyboy79

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top