I am trying to fill a web form through selenium VBA. I have used some codes which used to work well . Now I have updated to new version of office and now when I try the same code it says
" Automation error. Catastrophic failure"
Sub Rel_join()
Dim bot As New ChromeDriver
bot.Start "chrome", "******"
Dim x, y,w
bot.Get "/"
'bot.Window.Maximize
'login
bot.Wait 1500
bot.FindElementByXPath("//*[@id='lang-menu']/li[5]/a").Click
bot.Wait 500
'select department
d = "********"
Set ele = bot.FindElementById("ddldept").AsSelect
ele.SelectByText [d]
bot.FindElementByXPath("//input[@id='txtusername']").SendKeys "*****"
bot.FindElementByXPath("//input[@id='txtpwd']").SendKeys "******"
Stop
'Navigate to service book
bot.Get "***********URL"
For y = 4 To 4
** x = ThisWorkbook.Sheets("sheet1").Range("w" & y).Value**
cSCRIPT = "document.getElementById('txtempcd').value='" & x & "'"
bot.ExecuteScript cSCRIPT
Stop
cSCRIPT = "document.getElementById('Save').click()"
bot.ExecuteScript cSCRIPT
bot.SwitchToAlert.Accept
bot.Wait 3000
Next y
End Sub
I have also noticed that this error is shown on the line
** x = ThisWorkbook.Sheets("sheet1").Range("w" & y).Value**