-1
Sub accessExistingIEtabs()

     boolWindowFound = False
     Set objShell = CreateObject("Shell.Application")
     WinCount = objShell.Windows.Count
     winNo = 0
        Set IE = objShell.Windows(winNo)
         boolWindowFound = True
         If boolWindowFound Then
         Set doc = IE.document
         End If
                doc.getElementsByClassName("a-input-text a-form-normal ui-autocomplete-nested-button ui- 
                autocomplete-input")(0).Value = "italy"

end sub

'this code work just on tab number 0 I WANT TO USE EDIT TO IT SO I CAN CONTROL MULTIPLE PAGES LIKE' 'TAB 1 AND TAB 2 AND MORE TO DO DATA ENTRY TO MULTIPLE PAGES BY GETTING INFORMATION FROM EXCEL BUT' ' 'AT SAME TIME NOT TAB BY TAB' ? end sub

Tim Williams
  • 154,628
  • 8
  • 97
  • 125
  • 4
    Please don't SHOUT here- we can all hear you in regular case. – Tim Williams Feb 18 '20 at 16:13
  • sorry i don't understand you english isn't my language – aswan aswan Feb 18 '20 at 16:16
  • What do you mean by `tab` without seeing the site, its hard to advise, you may have to adjust the `(0)` after getting the elements. Or loop through your windows `objShell.Windows(winNo)` incrementing winNo and looking at what it contains. – Nathan_Sav Feb 18 '20 at 17:37
  • You know, if you set *boolWindowFound = True* and asking in the next line for *boolWindowFound = True* that always matches? Only to talk about one problem in your code. Whats about *WinCount = objShell.Windows.Count*? Only to talk about another part of your "code". Sorry, but almost everything in your code is wrong and I think nobody realy knows what you want. – Zwenn Feb 19 '20 at 00:10

1 Answers1

0

You said,

this code work just on tab number 0 I WANT TO USE EDIT TO IT SO I CAN CONTROL MULTIPLE PAGES LIKE' 'TAB 1 AND TAB 2 AND MORE TO DO DATA ENTRY TO MULTIPLE PAGES BY GETTING INFORMATION FROM EXCEL BUT' ' 'AT SAME TIME NOT TAB BY TAB

To execute some code simultaneously, the user needs to create multiple threads.

For your information, multithreading is not supported in VBA. VBA can work on single thread at a time. So it is not possible to fulfill your requirement with VBA code to do the data entry in multiple pages at the same time.

You can do the data entry tab by tab.

If you still need to work with VBA then you can refer links below may give you some workaround ideas.

  1. Multi-threading in VBA

  2. Excel/VBA : Multi-threading example

  3. EXCEL VBA MULTITHREADING

Deepak-MSFT
  • 10,379
  • 1
  • 12
  • 19