Is PowerPoint VBA not the same?

prabha_friend

Prabhakaran Karuppaih
Local time
Today, 05:07
Joined
Mar 22, 2009
Messages
1,026
Code:
Sub Test()
Dim EdgeofTable As Single
EdgeofTable = ActivePresentation.Slides(1).Shapes("Table 1").Table.Cell(ActivePresentation.Slides(1).Shapes("Table 1").Table.Rows.Count, ActivePresentation.Slides(1).Shapes("Table 1").Table.Columns.Count).Shape.Top + ActivePresentation.Slides(1).Shapes("Table 1").Table.Cell(ActivePresentation.Slides(1).Shapes("Table 1").Table.Rows.Count, ActivePresentation.Slides(1).Shapes("Table 1").Table.Columns.Count).Shape.Height
Do Until EdgeofTable <= 480
    ActivePresentation.Slides(1).Shapes("Table 1").Table.Rows(ActivePresentation.Slides(1).Shapes("Table 1").Table.Rows.Count).Delete
Loop
End Sub

Why EdgeofTable is not getting updated on every iteration?
 
Looks like EdgeOfTable = xxx needs to be inside the loop - ?
 
Looks like EdgeOfTable = xxx needs to be inside the loop - ?

Hi Ken,
Thanks to your reply. I believe its not the case in Excel VBA. So can we conclude that VBA in Powerpoint is not the same to the VBA in Excel regarding this scenario?
 
Excel VBA is certainly different from PP VBA in that the programs do not share all the objects in either program.

But this is not the reason your variable is not being updated. This is because the variable, as pointed out in the other response to you, is not included in the loop, and consequently is not changed from the initial value you have given it.
 

Users who are viewing this thread

Back
Top Bottom