Insert header into Data table

What is easiest way to add header into filled Data table before writing data into excel file?
I’m trying with Insert Rows activity, but don’t know what to put into first field:

image

image

Remark: tabelaFilter is Data table in which I have to put header…

1 Like

Hi

I think you are in right approach

Consider these two main properties

  • Where - Select from the drop-down menu the position within the selection for In what table or range where to insert the rows: Start, End, or Specific index. If you select Specific index , the Row number field appears where you must indicate the number of the row in your selection to use as starting position.
  • Has headers - Select this option if your selection for In what table or range includes a header row. If selected, the first row in your selection is not counted when the position where to insert the rows is determined.
    For example, if you select to insert two rows at the start of the range A8:C10 and Has headers is selected, the rows are inserted below A8:A10. If Has headers is not selected, the rows are inserted above A8:A10.

So
In where property mention as start
In Has Headers property disable ir

Cheers @Olivera_Kalinic

HI @Olivera_Kalinic

Refer the ss for info

Look into the documentation

Regards
Gokul

1 Like

Ok, I did all like you suggested, but still have problem with In what table or range field

image

What should I put in it? I tried with Data table name (tabelaFilter), but this error appears

image

1 Like

Fine

Use a activity named Use Excel file and pass the filepath as input

Inside that use a Insert row activity and click on plus symbol in table or range field

And Click plus button|autoxautoplus button|autoxauto on the right side of the field, then, from the menu, select the file and then a sheet, table, or range where to insert the rows, or select Indicate in Excel to indicate a range directly from the file.

Cheers @Olivera_Kalinic

In What table or range I thinks so you can’t able to pass Dt variable there

Excel.Sheet(OutputDt)

OutputDt → String Variable

Regards
Gokul

Were you able to insert row now @Olivera_Kalinic

I managed to insert empty row at the start of excel file, using

image

But, when I try to insert values into that empty row, using

image
nothing is inserted.

Inside Build data table activity I just added header.

Is there any other way to insert header into first empty row?

HI @Olivera_Kalinic

In this case

You can try with Insert Column Activity

Have a look on the thread

Regards
Gokul

Adding value to those header can be done with simple write cell activity
Use n number of such activity to give name for all columns

@Olivera_Kalinic

Hi @Olivera_Kalinic ,

If you already do have a Datatable, and you want to add an Extra Column to it, It can be done using Add Data Column Activity with the Column name as provided.

You could then Write the Datatable to the Excel Sheet.

Let us know if this method doesn’t work for your case.

I tried, but getting error below

image

Before using Write cell activity Keep

Kill process Activity → “EXCEL”
and also
Delay activity → 00:00:05

And try it @Olivera_Kalinic

Regards
Gokul

I added it, but the same error appears…

You can try with Add Data Column activity @Olivera_Kalinic

But, I don’t need to add new columns, just to insert values into first empty row:

Alternative method @Olivera_Kalinic

Use Workbook Write cell activity Instead of using Modern activity

image

Regards
Gokul

It works, thanks…

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.