Question

5
Replies
336
Views
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
Posted: 21 Mar 2018 7:58 EDT
Last activity: 26 Mar 2018 7:17 EDT
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, This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.