excel.vba 453 B

1234567891011121314151617
  1. Sub load()
  2. progpath = Environ("USERPROFILE") & "\bin\contactsync"
  3. ' Shell Runs async
  4. 'ChDir progpath
  5. 'Shell progpath & "\test.bat", vbNormalFocus
  6. ' wsh runs sync
  7. Dim wsh As Object
  8. Set wsh = VBA.CreateObject("WScript.Shell")
  9. Dim waitOnReturn As Boolean: waitOnReturn = True
  10. Dim windowStyle As Integer: windowStyle = 1
  11. wsh.Run progpath & "\test.bat", windowStyle, waitOnReturn
  12. Range("book").ListObject.QueryTable.Refresh BackgroundQuery:=False
  13. End Sub