want to convert left aligned value into right aligned value
Hi,
If you change format to number also it will not remove that error on convert to number in the excel. use the invoke code activity with below vb code to change the format.
Dim excel As Microsoft.Office.Interop.Excel.Application
Dim wb As Microsoft.Office.Interop.Excel.Workbook
Dim ws As Microsoft.Office.Interop.Excel.Worksheet
Dim cell As Microsoft.Office.Interop.Excel.Range
Try
excel = New Microsoft.Office.Interop.Excel.ApplicationClass
wb = excel.Workbooks.Open(“Your excel file path”)
excel.Visible=True
ws=CType(wb.Sheets(“Your Sheet Name”),Microsoft.Office.Interop.Excel.Worksheet)
ws.Activate
For Each cell In ws.Range(“E2:E10”).Cells
cell.Value = cell.Value
Next
Catch es As Exception
'System.Windows.MessageBox.Show(es.Message)
End Try
wb.Save
wb.close
excel.Quit
wb=Nothing
ws=Nothing
excel=Nothing
GC.Collect()
Use this syntax Currentrow(“DEBITS”).ToString(“#,##0.00”)
which will be able to get your desired output
Thanks,
is this need any packages to be installed before using invoke code
yeah install microsoft.office.interop.excel pakcage. For me also i have faced the same convert to number warning error for all the cells. i have resolved with the above method. thanks.
Hi,
you are checking in project dependencies. you have to check in all packages. thanks.
Same issue
not sure may be we have to check the settings for the activities feed. lets leave it just try to add the name space in the project. like below and try that invoke code activity.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.