AW: Hyperlinks aus PPT-Datei in Excel anzeigen lassen
25.07.2016 12:36:22
Michael
Hallo!
Mit diesem Code lassen sich meine Hyperlinks schon anzeigen.
Ja, ist klar; deswegen hab ich Dir auch den Link genannt ;-).
gibt es nun die Möglichkeit mir meine Ergebnisse auch in Excel in einer Tabelle anzeigen zu lassen?
Ja sicher, statt in einer Msg-Box kannst Du die Ergebnisse ja zB zunächst in einer Variablen sammeln und diese dann in eine Zelle schreiben; oder Du schreibst das schleifenweise in Zellen.
Allerdings kannst Du den Code, so wie er oben ist, nicht direkt aus Excel laufen lassen, da dieser ein PowerPoint-Makro ist.
Schematisch (ungetestet):
Sub ShowMeTheHyperlinks()
Const STR_PRES = "C:\Irgendwo\MeinePresi.pptx" 'Dateipfad zur Präsentation
Dim Pp As Object
Dim Pres As Object
Dim oSl As Object
Dim oHl As Hyperlink
Dim Wb As Workbook
Dim Ws As Worksheet
Dim i&
Set Wb = ThisWorkbook
Set Ws = Wb.Worksheets("Tabelle1") 'Ausgabe auf diesem Blatt
Set Pp = CreateObject("PowerPoint.Application")
Pp.Visible = True
Set Pres = Pp.presentations.Open(STR_PRES)
For Each oSl In Pres.Slides
For Each oHl In oSl.Hyperlinks
If oHl.Type = msoHyperlinkShape Then
With Ws
i = .Cells(.Rows.Count, 1).End(xlUp).Row
.Cells(i, 1).Value = "HL in shape"
.Cells(i, 2).Value = "Slide: " & vbTab & oSl.SlideIndex
.Cells(i, 3).Value = "Shape: " & oHl.Parent.Parent.Name
.Cells(i, 4).Value = "Address:" & vbTab & oHl.Address
.Cells(i, 5).Value = "SubAddress:" & vbTab & oHl.SubAddress
End With
Else
With Ws
i = .Cells(.Rows.Count, 1).End(xlUp).Row
.Cells(i, 1).Value = "HL in text"
.Cells(i, 2).Value = "Slide: " & vbTab & oSl.SlideIndex
.Cells(i, 3).Value = "Shape: " & oHl.Parent.Parent.Name
.Cells(i, 4).Value = "Address:" & vbTab & oHl.Address
.Cells(i, 5).Value = "SubAddress:" & vbTab & oHl.SubAddress
End With
End If
Next
Next
End Sub
LG
Michael