Excel Macro Code issue

Hi,

Did you tried like below. thanks.

Sub Formatting(FilePath As String)

With ActiveSheet.QueryTables.Add(Connection:=“TEXT;” + FilePath, Destination:=Range(“$A$1”))