5 Excel Work sheets are open - 1 macro enabled file

Rohith1324

Board Regular
Joined
Feb 27, 2018
Messages
114
Hi,

Users are having 5 or more excel sheets open in their system and out of which one File is macro Enabled file ( which will be interacting with Web Page ).

when the VBA code is running and interacting with Web Page users are unable to work on any other worksheets open in their system.

do we have any way to free the other Worksheets so that users can do their work in normal worksheets.

Regards,
Rohith M
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Did you try opening them in a separate instance of Excel?
See: 4 Ways to Open Multiple Instances of Excel - Excel Gorilla
Thanks for letting me know that there is an option of doing it...
I would need your support - Can you help me with VBA Code method included in my existing code....so that when the code execution start it will start in a new Instance... ( or) may be the code enables as soon as this VBA Code Spreadsheet is opened in other instance.

would you please able to help ...

my Code is as below :

Sub tstsitesubmission()
Dim bot As New WebDriver, ele As WebElement
Dim C As Range
Dim i As Integer
Dim OName As String
Dim Aname As String
Dim Tname As String

'bot.AddArgument ("headless")
'bot.AddArgument "window-size=1920,1080"
bot.Start "Chrome", "testsite.com"
bot.Window.Maximize
bot.Get "https:testsite.com"
bot.Wait 500
bot.FindElementByXPath("//*[@id='userNme']").SendKeys ActiveSheet.Range("B1").Value
bot.FindElementByXPath("//*[@id='passwd']").SendKeys ActiveSheet.Range("B3").Value
bot.SendKeys bot.Keys.Tab
bot.SendKeys bot.Keys.Enter
For Each C In Range("A6:A" & Cells(Rows.Count, "A").End(xlUp).Row).Cells
bot.Timeouts.PageLoad = 40000
OName = C.Offset(0, 12).Value
Aname = C.Offset(0, 13).Value
Tname = C.Offset(0, 14).Value
Debug.Print OName
Debug.Print Aname
Debug.Print Tname
DoEvents
bot.Wait 400
bot.FindElementByXPath("//*[@id='createNewForm']/div[3]/div/div/button/span[1]", timeout:=40000).WaitEnabled(True).Click
bot.FindElementByXPath("//*[@id='createNewForm']/div[3]/div/div/div/ul/li[" & OName & "]/a/span[1]", timeout:=40000).WaitEnabled(True).Click
bot.Wait 200
bot.FindElementByXPath("//*[@id='cpoNo']").SendKeys C.Offset(0, 4).Value
bot.Wait 200
bot.FindElementByXPath("//*[@id='reqDesc']").SendKeys C.Offset(0, 5).Value
bot.FindElementByXPath("//*[@id='main']/div[2]").ScrollIntoView
bot.SendKeys bot.Keys.Tab
bot.FindElementByXPath("//*[@id='createFormsubmit']").Click
Next C
MsgBox "Task Completed"
End Sub
 
Upvote 0
I am not sure how to open another instance of Excel with VBA code.
I do a search and found a few old threads on it. This one looked like it might be promising: Open NEw instance of Excel through MAcro

Sorry, that is the best I can do.
 
Upvote 0

Forum statistics

Threads
1,214,954
Messages
6,122,462
Members
449,085
Latest member
ExcelError

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