PP-Präsentation aus Excel starten/aktualieseren.
19.07.2004 09:50:46
Anja
ich brauche dringend eure Hilfe.
ich habe ein folgendes Problem.
ich möchte aus meiner Excel Datei aus eine per Knopfdruck eine PowerPoint
Präsentation starten, und zwar so dass die Verknüpfunge disere PP-Präsentation
von der geöffneten Excel Datei aktualisiert werden.
Kann mir da jemand helfen:
Ich habe was in VB geschrieben, es startet nur meine Präsentation,
aber aktualisiert die Verknüpfunge nicht... :-(
Was mache ich bloß falsch?
Option Explicit
Private Declare
Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, _
ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal lpnShowCmd As Long) As Long
Sub PowerPointStarten()
Dim ppApp As Object
Dim ppP As Object
Dim sFile As String
Dim sh As Object
sFile = ThisWorkbook.Path & "\POWER_POINT_KPI\KPI.ppt"
If Dir(sFile) = "" Then
Beep
MsgBox "Die Datei " & sFile & " existiert nicht!"
Exit Sub
End If
Set ppApp = CreateObject("PowerPoint.Application")
ppApp.Visible = msoTrue
Set ppP = ppApp.Presentations.Open(sFile)
'Verknüpfungen updaten
For Each sh In ppP.Slides(1).Shapes
If sh.Type = msoLinkedOLEObject Then
With sh.LinkFormat
.Update
End With
End If
Next
ppP.SlideShowSettings.Run
' ppApp.Quit
Set ppP = Nothing
Set ppApp = Nothing
End Sub