Convert cell or range value from text to number

Hi @Nightowl_music ,

ok. Please find the below code it will help you to achieve your task. modify the code(range, excel path and sheet name) to suit your requirement.

use the below code invoke code activity to perform the action changing the format from text to number.

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()

and also make sure that you imported the following package Microsoft.Office.Interop.Excel