werafa
07-14-2013, 04:39 PM
Hi all,
This sub used to work fine, and has suddenly decided to break.
It takes an excel range, pastes as text, and sets some formatting.
it is now breaking at the "Set MyShapeRange....."
Sub PasteFooter()
'paste text from excel as unformatted text,
'remove extra blanks inserted by excel 2013 when using centred allignment
'then resize to full width
Dim myShapeRange As ShapeRange
Dim myShape As Shape
Dim myString As String
Set myShapeRange = ActiveWindow.Selection.SlideRange(1).Shapes.PasteSpecial(ppPasteText)
Set myShape = myShapeRange(myShapeRange.Count)
With myShape
myString = .TextFrame.TextRange.Text
If myString = "" Then myString = "Add Text"
Do While InStr(myString, " ") > 0
myString = Replace(myString, " ", " ")
Loop
Do While InStr(myString, vbTab) > 0
myString = Replace(myString, vbTab, "")
Loop
.TextFrame.TextRange.Text = myString
.TextFrame.TextRange.ParagraphFormat.Bullet = msoTrue
.TextFrame.TextRange.ParagraphFormat.Bullet.Type = ppBulletUnnumbered
.LockAspectRatio = False
.Top = 480 'points from bottom
.Left = 20 'points from left
.Width = 680 'points wide
.Height = 60 'points high
End With
Set myShape = Nothing
Set myShapeRange = Nothing
End Sub
The error is: Shapes (unknown Member): Invalid request. the specified data type is unavailable.
Does anyone know what would cause this? Windows has just installed some updates - could it be a bad codeing habit that is now blocked?
Thanks
Tim
This sub used to work fine, and has suddenly decided to break.
It takes an excel range, pastes as text, and sets some formatting.
it is now breaking at the "Set MyShapeRange....."
Sub PasteFooter()
'paste text from excel as unformatted text,
'remove extra blanks inserted by excel 2013 when using centred allignment
'then resize to full width
Dim myShapeRange As ShapeRange
Dim myShape As Shape
Dim myString As String
Set myShapeRange = ActiveWindow.Selection.SlideRange(1).Shapes.PasteSpecial(ppPasteText)
Set myShape = myShapeRange(myShapeRange.Count)
With myShape
myString = .TextFrame.TextRange.Text
If myString = "" Then myString = "Add Text"
Do While InStr(myString, " ") > 0
myString = Replace(myString, " ", " ")
Loop
Do While InStr(myString, vbTab) > 0
myString = Replace(myString, vbTab, "")
Loop
.TextFrame.TextRange.Text = myString
.TextFrame.TextRange.ParagraphFormat.Bullet = msoTrue
.TextFrame.TextRange.ParagraphFormat.Bullet.Type = ppBulletUnnumbered
.LockAspectRatio = False
.Top = 480 'points from bottom
.Left = 20 'points from left
.Width = 680 'points wide
.Height = 60 'points high
End With
Set myShape = Nothing
Set myShapeRange = Nothing
End Sub
The error is: Shapes (unknown Member): Invalid request. the specified data type is unavailable.
Does anyone know what would cause this? Windows has just installed some updates - could it be a bad codeing habit that is now blocked?
Thanks
Tim