title image


Smiley Re: Wie kann ich über Excel VBA den Acrobat Reader starten?
Hi,



mit folgendem Code:



Public Const PROCESS_QUERY_INFORMATION = &H400

Public Const WAIT_TIMEOUT = &H102&



Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, _

ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long



Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, _

ByVal dwMilliseconds As Long) As Long



Sub StartenAcrobatReader()

Call Win32WaitTilFinished("C:\Programme\Adobe\Acrobat 6.0\Reader\AcroRd32.exe C:\Test.pdf")

End Sub



Sub Win32WaitTilFinished(ProgEXE As String)

Dim ProcessID As Long

Dim hProcess As Long

Dim RetVal As Long

ProcessID = Shell(ProgEXE, vbMinimizedFocus)

hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False, ProcessID)

Do

DoEvents

RetVal = WaitForSingleObject(hProcess, 50)

Loop Until RetVal WAIT_TIMEOUT

End Sub





Gruss Jürgen

geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: