Close Pop-Up Using On Element Appear Activity

Hello…

I am doing automation where I am using the Excel application Scope, when I run the bot, it opens a pop-up and because of that bot throws an error. I searched and found that I could use the ON ELEMENT APPEAR activity to close the Pop-up.

But is shows an Alert Symbol and if debugged throws an error of time out.

Does any one have an idea about this?

Thank you in advance

@Anirudh_Tugawe
Wait active and wait visible to true it is a boolean set it as TRUE

I hope this works

Hi @Anirudh_Tugawe

Use Element Exists activity and indicate the Close in the pop up message. Store the output in a avariable which of datatype System.Boolean. After that use If condition and pass that boolean variable and in the Then section you can give Click activity.

Regards


it worked but the alert symbol is still there.

@Anirudh_Tugawe

this is something a warning message so you need to connect to your it team.Try to open the excel manually in that time also it shows a pop up …?

Hi @Anirudh_Tugawe

Try contacting the IT team and activate the Microsofty Office license. This should solve that problem.

Regards

1 Like

yes, now it says to activate the Excel, Thankyou

1 Like

actually my automation demanded that the sheet name will change everytime the client sends the mail.for that i was using excel application scope and now i dont know how it works with read range workbook activity.

@Anirudh_Tugawe

If your sheet name changes everytime then you keep the sheet name in a variable or asset.So that you will change the sheet name dynamically.

or

you have to get the sheet name in the excel before you reading the excel

Storing it as a variable makes sense, can you send in the screenshot for a better understanding.

Hi @Anirudh_Tugawe

If you want to use Read Range Workbook then use the below code in Invoke Code:

Dim app As Microsoft.Office.Interop.Excel.Application
Dim wb As Microsoft.Office.Interop.Excel.Workbook
Dim firstSheet As Microsoft.Office.Interop.Excel.Worksheet
 
app = New Microsoft.Office.Interop.Excel.Application()
app.Visible = False
app.AskToUpdateLinks = False
wb = app.Workbooks.Open(ExcelFilePath, False, False)
 
If wb.Sheets.Count > 0 Then
    firstSheet = CType(wb.Sheets(1), Microsoft.Office.Interop.Excel.Worksheet)
    sheetName = firstSheet.Name
Else
    ' Handle the case where there are no sheets in the workbook
    ' You can set a default value or raise an error as needed.
    sheetName = "No Sheets Found"
End If
 
wb.Close()
app.Quit()

ExcelFilePath is In Argument and pass the excel file Path
sheetName is out Argument and Value side create a variable SheetName.

After that Use Read Range Workbook, pass the excel file path, Sheet name pass the variable SheetName.

Regards

@Anirudh_Tugawe

Workbook=New WorkbookApplication("C:\Users\rlgandu\Downloads\ECOO Autoreport Status 2024.xlsx")
Sheetnames=Workbook.GetSheets.ToArray

This will get you the sheet names dynamically.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.