refresh.xls.vb 912 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. Public dashboard As String
  2. Function Oeffne(datei As String)
  3. Workbooks.Open Filename:=datei
  4. End Function
  5. Private Function WorkbookAktualisieren()
  6. OpenAllLinks
  7. ' ActiveWorkbook.UpdateLink Name:=ActiveWorkbook.LinkSources
  8. Calculate
  9. ActiveWorkbook.RefreshAll
  10. End Function
  11. Private Function OpenAllLinks()
  12. Dim arLinks As Variant
  13. Dim intIndex As Integer
  14. Dim workbookName As String
  15. workbookName = ActiveWorkbook.Name
  16. arLinks = Workbooks(workbookName).LinkSources(xlExcelLinks)
  17. If Not IsEmpty(arLinks) Then
  18. For intIndex = LBound(arLinks) To UBound(arLinks)
  19. Workbooks(workbookName).OpenLinks arLinks(intIndex)
  20. Next intIndex
  21. End If
  22. Workbooks(workbookName).Activate
  23. End Function
  24. Sub Workflow(datei As String)
  25. Oeffne datei
  26. WorkbookAktualisieren
  27. ActiveWorkbook.Save
  28. Application.Quit
  29. End Sub
  30. Sub MakroTest()
  31. Workflow "test"
  32. End Sub