Question
5
Replies
328
Views
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();
Just add input parameters to your script. Prior to build 8.0.1053 it is done this way:
Since 8.0.1053 you just add it to the Method definition directly.