RefreshAll
Enviado: 08 Mar 2021 às 14:08
boa tarde,
está me a dar o seguinte erro quando corro um vbs
"Esta ação cancelará um comando 'Atualizar Dados' pendente. Continuar?"
Set fso = CreateObject("Scripting.FileSystemObject")
Set xl = CreateObject("Excel.Application")
xl.Visible = True
For Each f In fso.GetFolder("C:\Users\Utilizador\Documents\Precarios\").Files
If LCase(fso.GetExtensionName(f.Name)) = "xlsx" Then
Set wb = xl.Workbooks.Open(f.Path)
wb.RefreshAll
wb.Save
wb.Close
End If
Next
xl.Quit
O que estou a fazer mal?
Obrigado
está me a dar o seguinte erro quando corro um vbs
"Esta ação cancelará um comando 'Atualizar Dados' pendente. Continuar?"
Set fso = CreateObject("Scripting.FileSystemObject")
Set xl = CreateObject("Excel.Application")
xl.Visible = True
For Each f In fso.GetFolder("C:\Users\Utilizador\Documents\Precarios\").Files
If LCase(fso.GetExtensionName(f.Name)) = "xlsx" Then
Set wb = xl.Workbooks.Open(f.Path)
wb.RefreshAll
wb.Save
wb.Close
End If
Next
xl.Quit
O que estou a fazer mal?
Obrigado