Yes, exactly. I recorded the VBA and then I user invoke code to run it.
He cannot install any packages
@pllo2ptk @AshwinS2
I can not execute macros also because of security policy in the Organization.
I need to invoke vba code, but I do not know exactly how it should be.
Does anybody know how to write vba code for invoking just to merge two different ranges of cells in the active excel which is already open , because I am inside excel application scope activity?
You can always create your own activity for merging files (write it in C#).
There is no possibility to invoke VBA code from the Uipath directly.
Invoke Code is for run Visual Basic (not Visual Basic for Application) code.
Anyway, you can try find guides how to manipulate excel file with VB.
Yes, you read the excel file and store your data on a datatable, than use merge to merge the data you want…
@mz3bel I just want to merge cells in excel, in order to make A1:C1 to show like 1 cell
Not in datatable.
will be like this:
Dim xl As Excel.Application = New Excel.ApplicationClass()
Dim wb As Excel.Workbook = xl.Workbooks.Add(Excel.XlWBATemplate.xlWBATWorkshe, et)
Dim ws As Excel.Worksheet = CType(wb.ActiveSheet, Excel.Worksheet)
Dim range As Excel.Range = ws.get_Range(ws.Cells(1, 1), ws.Cells(1, 2))
range.Merge(True)
i imagined you had imported the namespace already, you need to add this import to your project:
Microsoft.Office.Interop.Excel
it does not begin with Excel… it is Microsoft.Office.Interop.Excel
I think we use the Invoke VBA code from Excel Application Scope. It even works for non xlsm file type.
My excel cell is already merge pls help me to find out this