Line:14
Char:6
Error:Expected'Sub'
Code:800A03F8
Source:Microsoft VBScript compilation error
xlsFileCons   = "C:\TEST.xlsx"Call RefreshExcel(xlsFileCons)Sub RefreshExcel(f)
    
    Set ExcelApplication = CreateObject("Excel.Application")
    Set WB = ExcelApplication.Workbooks.Open(f)    ExcelApplication.DisplayAlerts = False 
    WB.Worksheets("Sheet1").QueryTable("表_TEST").Refresh
End If
    WB.Save
    WB.Close    Set WB = Nothing
    Set ExcelApplication = NothingEnd Sub