importing powerpoint table to excel

  • Thread starter Thread starter Lynn
  • Start date Start date
I saw thgis posting on Saturday morning but had the macro stored on a
different computer. Here is the code. The code goes through each sheet in
the power point file and gets each table. The tables are within shapes
objects on each power point sheet.

Sub GetSlides()

FName = "c:\temp\test.ppt"
Set obj = GetObject(FName)
obj.Application.Visible = True

Set ExcelSht = ThisWorkbook.Sheets(1)
NewRow = 1

For Each slide In obj.Slides
With slide.Shapes
For i = 1 To .Count
If .Item(i).HasTable Then
Set MyTable = .Item(i).Table
For Each MyRow In MyTable.Rows
Col = 1
For Each MyCol In MyRow.Cells
With ExcelSht
Set DataCell = MyCol.Shape.TextFrame.TextRange
.Cells(NewRow, Col) = DataCell.Text
Col = Col + 1
End With
Next MyCol
NewRow = NewRow + 1
Next MyRow
End If
Next
End With
Next slide

obj.Close
Set obj = Nothing
End Sub
 
Back
Top