Question

5
Replies
328
Views
Close popover
Sean Bailey (SeanB897)
Nationwide Building Society

Nationwide Building Society
GB
SeanB897 Member since 2017 24 posts
Nationwide Building Society
Posted: March 21, 2018
Last activity: March 26, 2018
Closed
Solved

Adding Parameters (Robotics)

All,

I have the following code which I am using for deleting row in excel, I would like to add a parameter as the File path location will be variable.

Previously there an input box on the script window which allowed you to delcare the parameters for the script but this is no longer there.

Excel.Application myApp;
           Excel.Workbook myWorkBook;
           Excel.Worksheet myWorkSheet;
           Excel.Range range;
           myApp = new Excel.Application();
           myWorkBook = myApp.Workbooks.Open("FILE PATH", 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false   , 0, true, 1, 0);
           myWorkSheet = (Excel.Worksheet)myWorkBook.Worksheets.get_Item(1);
           range = (Excel.Range)myWorkSheet.Application.Rows[1, Type.Missing];
           range.Select();
           range.Delete(Excel.XlDirection.xlUp);
           myWorkBook.Close(true);
           myApp.Quit();
Robotic Process Automation
Moderation Team has archived post