How to keep Excel file open?

HI!

I am using Studio Pro version 2020.10.12. The Project Dependencies version for Excel Activities is 2.11.4.

I am using the Use Excel File for Studio X activity or the Excel Application Scope for Studio Pro (happens the same with either option) and can’t find an option to keep the excel file open after the required actions are performed. I saw a checkbox that I should see on the options on the right but on my version there is no such checkbook. Is there any other way of keeping Excel open?

Hi,

Can you try to set workbookapplication type variable at Workbook property in ExcelApplicationScope activity?

image

Regards,

Hi,
If the Excel workbook is already open prior to Excel Application Scope, then the activity will not close it after completing it’s execution.
To open the workbook, use the “Start Process” activity, with the following arguments -
Provide the executable path of “Excel.exe” (try with just Excel.exe, this should work as well)
Provide the App Argument as your complete file path.

Thanks,
Nishant

1 Like

Thank you for your responses.

Here is the current scenario. I have a .csv file that needs to be converted to .xlsx format. I am using the Open application activity to open Excel and then saving the .csv into .xlsx and adding the date and time to the name of the file. With this the file is open. Instead of using from this point on the Excel Application scope I could use a sequence to work on the Excel file as I need to delete a few columns, adjust the width etc. If I do it this way the file should still be kept open at the end of the steps right? How should I approach this?

A better way to do this part is to Read CSV into a datatable then Write Range to a new Excel file. You can delete the necessary columns from the datatable before writing to Excel.

Then open the Excel file with Start Process (not Excel Application Scope) to do the other things you need to do - adjusting columns, etc.

Thank You for your suggestion. I will try that.

I am facing an issue when using the Text import Wizard from Excel when opening the .csv file. This data has headers that should be accommodated in columns. I am using the Delimited option and choosing that my data has headers, then I choose the comma option and when Excel doe the import all of the data that should be in columns are all mix altogether on column a.

If I use the method you are suggesting will this help me with this issue?