Run Macros in excel with database connection into that excel file

I am considering whether or not a process can be automated and I have a question.

I have an excel with a macro, I know that we can use activities to run this macro without any problem but I have the following questions:

1- If the file has a macro but this macro connects to a database and makes a query, would the macro work?
2- If at the moment of running the macro some windows appear where you must enter parameters in excel, would it work?
3- If for some reason at the moment of running the macro the connection to the database is lost and it must be done through Excel, it would have to be done through UI, right?
3- Would you advise to do all this by UI ?

There will be no direct answers to your questions.

You will need to try by yourself all the macros in Excel, including the database connection and manipulations.

You will do the operations through UI only as a last resort, as UI interactions are prone to break due to system or targeted application changes.

You will catch the exceptions in Studio project and you will create steps to overcome those issues.

I hope that helped you a little bit.