1

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**
2
  • Just newer version of office or did you get windows 10 thrown in? Where there any other software updates (dependencies e.g. browser, .Net framework) that happened? Commented Nov 20, 2019 at 4:39
  • No I have only upgraded my office from office 2016 home edition to office 365. However my system shut off some two days ago abruptly leading to excel locked and became read only. However it is now working properly. Commented Nov 20, 2019 at 5:22

1 Answer 1

2

This error message...

Automation error. Catastrophic failure

...implies that there was an Automation error while accessing the excel sheet based on Office 365.


As per the discussion in Automation error: Catastrophic failure Problem with Excel 2016 the main problem is related to the version of Excel that comes with Office 365 is different from the version that is given to Enterprise users.


Solution

The easiest solution would be to save the file as an Excel Binary Workbook and use it in your automated tests

Sign up to request clarification or add additional context in comments.

1 Comment

Good to know + for that

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.