Hi Guys
I have Problem, i need a code for my Worksheet.
I already have a Code, but not the realy for that what i need to use.
How my Worksheet looks like: From the cells B1 - Z1 i post my hyperlinks to pdf files on my PC; the cells A2 - A30 are the names of person in the office.
What must de code do: I tag a cell under a hyperlink with an "x", sometimes i need more files to plot. I will only tag the cells, to say how many times i plot this file.
Sorry for my bad english. Thanks a lot for any help!

Sub pdf_mit_AR_drucken()
Set fs = CreateObject("Scripting.FileSystemObject")
Set WSHShell = CreateObject("WScript.Shell")
'Standarddrucker ermitteln
Dim objWMI As Object, objItem As Object
Set objWMI = GetObject("winmgmts:\\.\root\cimv2"). _
ExecQuery("Select * from Win32_Printer where Default = 'true'")
On Error Resume Next
For Each objItem In objWMI
standarddrucker = objItem.properties_.Item("Name").Value
Next
Set objWMI = Nothing
'Pfad zum AdobeReader ermitteln
On Error Resume Next
strBezeichnung = WSHShell.RegRead("HKCR\.pdf\")
strZuordnung = WSHShell.RegRead("HKEY_CLASSES_ROOT\" & strBezeichnung & "\shell\open\command\")
strZuordnung = Replace(strZuordnung, Chr(34), "")
posEXE = InStr(UCase(strZuordnung), ".EXE")
If posEXE > 0 Then
anwendung = Left(strZuordnung, posEXE + 3)
Else
MsgBox "Installieren Sie erst Adobe Reader,dann versuchen wir weiter."
Exit Sub
End If
prog = fs.getfile(anwendung).shortpath & " /t "
anwendung = fs.getfile(anwendung).Name
'Datei zum Drucken auswählen
datei = Application.GetOpenFilename("PDF Dateien (*.pdf), *.pdf")
If VarType(datei) = vbBoolean Then Exit Sub
datei = fs.getfile(datei).shortpath
'Datei drucken
prog = prog & datei & " " & Chr(34) & standarddrucker & Chr(34)
' MsgBox prog
WSHShell.Run prog, 6, False
pause
Set WSHShell = Nothing
Set fs = Nothing
End Sub
 
Sub Programm_killen()
strComputer = "."
'zu killendes Programm 'AcroRd32.exe'
strProgramm = "'" & anwendung & "'"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = " & strProgramm)
For Each objProcess In colProcessList
objProcess.Terminate
Debug.Print objProcess.Name
Next
End Sub
 
Sub pause()
Application.OnTime Time + TimeValue("00:00:05"), "reader_killen"
End Sub
 
Sub reader_killen()
Dim druck As String
druck = ""
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colPrintJobs = objWMIService.ExecQuery("Select * from Win32_PrintJob")
For Each objPrintJob In colPrintJobs
druck = druck & objPrintJob.Name
Debug.Print druck
Next
If druck = "" Then
Programm_killen
Else
pause
End If
End Sub