@Bhanu_Rathore Hello ,you can read range , output data table as string using the output data table activity and in an assign use string.replace method to remove all comma delimiters from the generated string , then write the string to the text file.
exactly. I meant with A to Z if the data are only in A to Z.
If you don’t give a number, the hole column will be copied.
A:B means: Columns A and B
A:Z means: Columns A to Z
D:AA means: Columns D to AA
etc.
You can read the count of rows and count of columns and set them to your range.
See the new code:
Dim xlApp As Microsoft.Office.Interop.Excel.Application = New Microsoft.Office.Interop.Excel.Application
Try
Dim xlWorkbook As Microsoft.Office.Interop.Excel.Workbook = xlApp.Workbooks.Open(Path)
'Define Excel Sheet
Dim xlWorksheet As Microsoft.Office.Interop.Excel.Worksheet
xlWorksheet = CType(xlWorkbook.Sheets("Sheet1"), Microsoft.Office.Interop.Excel.Worksheet)
'Activate Worksheet
xlWorksheet.Activate()
'Get Rows Count
Dim RowsCount As Integer
RowsCount = xlWorksheet.UsedRange.Rows.Count
'Get Columns Count
Dim ColumnsCount As Integer
ColumnsCount = xlWorksheet.UsedRange.Columns.Count
'Format the numbers in Excel for all cells in column A
'xlWorksheet.Range("A1:C5").Copy
xlWorksheet.Range(xlWorksheet.Cells(1,1),xlWorksheet.Cells(RowsCount,ColumnsCount)).Copy
'Close Workbook
xlWorkbook.Close
Catch ex As Exception
Throw ex
Finally
'Close Excel Application
xlApp.Quit
End Try