Clever-Excel-Forum

Normale Version: freigebenen Datei prüfen ob bereits geöffnet
Du siehst gerade eine vereinfachte Darstellung unserer Inhalte. Normale Ansicht mit richtiger Formatierung.
Seiten: 1 2 3
@Fen

Geht einfacher in Word:


Code:
Sub M_snb()
   For Each it In Tasks
      c00 = c00 & vbCr & it.Name
   Next
   ActiveDocument.Content = c00
End Sub
Dort werden alle 'Windows' gezeigt.

Du kannst z.B suchen auf:

Code:
Sub M_snb()
   For Each it In Tasks
      c00 = c00 & vbCr & it.Name
   Next
   msgbox "__very link.xlsb ist " & format(instr(c00,"Microsoft Excel - __very link.xlsb")<>0,"yes/no") & " geladen"
end sub
Hallo snb,

danke für den Code, auch die Konstruktion mit "Format" war für mich neu.

Als ich den Code abgespeichert habe, fand ich diesen xl-Code (hatte es aber vergessen):


Code:
https://officetricks.com/application-monitor-manage-terminate-tasks/

#################
all Tasks:

Option Explicit
'This code is downloaded from Officetricks.com
'Visit our site for more Free Excel Code
Sub Task_List_In_Excel()
  Dim oMgmt As Object, oProc As Object, oList As Object

  Set oMgmt = GetObject("winmgmts:")
  Set oProc = oMgmt.ExecQuery("Select * from Win32_Process")
  i = 1

  'Loop thru each process and application name
  For Each oList In oProc
      ThisWorkbook.Sheets(1).Cells(i, 1) = oList.Name
      i = i + 1
  Next

End Sub
###############

terminate processes

For Each oList In oProc
   
   'Check for Application Name. Kill Process if there is a Match
   If vba.Ucase(oList.Name) = vba.Ucase("notepad.exe") Then
      oList.Terminate
   End If
Next


mfg
@Fen

Die code ist VBA, jedoch kein Excel.

Weder:

Code:
Sub M_snb()
  with createobject("word.application")
   For Each it In .Tasks
      c00 = c00 & vbCr & it.Name
   Next
   .quit
  end with

  msgbox "__very link.xlsb ist " & format(instr(c00,"Microsoft Excel - __very link.xlsb")<>0,"yes/no") & " geladen"
end sub
Seiten: 1 2 3