I want to operate IE11 from VBA in Excel (Office 365) and use getElementsByClassName to count how many elements have the same class name.Error message
Run-time error '438':
The object does not support this property or method.
Checked Microsoft Scripting Runtime, Microsoft Internet Controls, and Microsoft HTML Object Library in reference settings
Private Sub CountClass () Dim IEobj As New Internet Explorer Medium IEobj.Navigate URL Call Util.WaitingForLoad (IEobj) 'Call a function that waits for IE loading and wait a little Dim myObj As Object Dim Counter As Integer For Each myObj In IEobj.Document.getElementsByClassName ("TestClass") ' Counter = Counter + 1 Next End Sub
・ I have made similar tools using Excel (Office 365) and IE11 before, and they still work, so I set them to the same code and reference settings as the tools that are working except URLs. I tried it, but the same error doesn't happen
・ Confirm that there is definitely at least one "TestClass" class on the site
・ After searching, I found that "s" of getElements is missing or ClassName is HTML Collection, etc., but I think there is no problem
・ The same error will occur even if it is executed after taking a long time to load IE and displaying it securely
・ GetElementById and getElementsByTagName work for some reason.
I'm sorry, please help.
Answer # 1
What is the document mode of IE displayed on the target "URL" page?
getElementsByClassNameis not supported for IE8 and below.
- excel vba find gives an error that the index is out of scope
- vba - i don't understand the cause of the error code "object variable or with block variable not set"
- vba - how to eliminate the error that occurs when the find method is repeated in for
- vba - i get a run-time error with a macro that automatically records the date that it was entered
- error when specifying cell of another workbook in vba
- vba - compile error: the constant is not defined
- error in vba printout method
- [vba] position error when pasting images
- vba - object definition error
- vba - i get "runtime error 424 object required"
- vba - no error occurs in docmdtransferspreadsheet in the form of operating access from excel
- vba - network interface: an error occurred while locating the specified server/instance
- i want to copy a sheet to the end of another book with vba, but i get an error
- vba "run-time error '1004'" error that cannot be copied
- vba - compile error correction candidate: about the end of the statement
- vba error handling
- error in vba split function
- excel vba causes automation error when duplicating sheet
- vba error handling index is not in the valid range
- vba error handling "" range "method failed:" _global "object"
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- python - you may need to restart the kernel to use updated packages error
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- python 3x - typeerror: 'method' object is not subscriptable
- xcode - pod install [!] no `podfile 'found in the project directory
- vuejs - [vuetify] unable to locate target [data-app] i want to unit test to avoid warning
- i want to call a child component method from a parent in vuejs