I would like to read a file in my desktop, store in a data table and write the output to an excel file which is already open. When I tried this using Read and Write range, the workbook closed after write operation. But I want it to be opened after the write operation. Can anyone help me with this problem?
Hi @Suruthimai_Rajean
Use excel application scope and write range excel!
Regards
After written the data in the excel
Can you try to use Excel application scope
Enable the properties → Visible
Regards
Gokul
Hey @Suruthimai_Rajan! If you try to write in an open excel you will get the following error!
You need to close the EXCEL instances before writing.
Look!
-
I will use excel “Test1” which will be the data source.
-
I’m going to read the data and store it in a variable of type DataTable that I named “dt_result”.
-
I will then close any open excel instance with “Kil process”
-
Now I’m going to write to my destination file that I named “Test2”, it’s blank.
-
Finally, I use the “Start Process” activity passing the excel path that received the writing so that it is opened.
Hope it helps!!
Hi Gabriel,
Thank you for your solution. But According to my usecase, I need to perform few more actions in the opened file and then only close.
If I close/kill the process and again reopen it, I might have to repeat Excel prompts user input again. And I was not able to save the prompts due to some security reasons.
So I would like to know if I can invoke a workflow within the Write range activity excel scope so that the excel file remains open until the Excel application scope ends?
Hi Gokul,
Thanks for your suggestion. But I have already tried enabling it and it did not work.
I tried it too but nothing works.
Please try to use start process in the start. Then perform operation with write range and check visible property in excel scope then other operations.
After all the work is done you can close the workbook.
Thanks,
Prankur
As I understand it, you could do the following. Instead of the “Write Range” activity that I sent earlier, use “Excel Application Scope” with the “Visible” property. This way you will be able to use Excel open and then you can write your data as well.