L
lance-news
Hey all,
I keep trying to select a range so I can do a search and replace but
I always get an object-defined error??
Sub test()
ActivePresentation.Slides(39).Select
Set SlideObject = ActivePresentation.Slides(39)
For Each ShapeObject In SlideObject.Shapes
If ShapeObject.Type = msoEmbeddedOLEObject Then
If Mid$(ShapeObject.OLEFormat.ProgID, 1, 11) =
"Excel.Sheet" Then
Set oXLBook = ShapeObject.OLEFormat.Object
'''''''''''''''This line is causing me grief '''''''''''''''''''''
oXLBook.Worksheets("Sheet1").Range("B4:O30").Select
Selection.Find(What:="<1%", After:=ActiveCell, LookIn:=xlFormulas,
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False, SearchFormat:=False).Activate
Selection.Replace What:="<1%", Replacement:="0", LookAt:=xlPart,
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False,
ReplaceFormat:=False
End If
End If
Next ShapeObject
End Sub
I keep trying to select a range so I can do a search and replace but
I always get an object-defined error??
Sub test()
ActivePresentation.Slides(39).Select
Set SlideObject = ActivePresentation.Slides(39)
For Each ShapeObject In SlideObject.Shapes
If ShapeObject.Type = msoEmbeddedOLEObject Then
If Mid$(ShapeObject.OLEFormat.ProgID, 1, 11) =
"Excel.Sheet" Then
Set oXLBook = ShapeObject.OLEFormat.Object
'''''''''''''''This line is causing me grief '''''''''''''''''''''
oXLBook.Worksheets("Sheet1").Range("B4:O30").Select
Selection.Find(What:="<1%", After:=ActiveCell, LookIn:=xlFormulas,
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False, SearchFormat:=False).Activate
Selection.Replace What:="<1%", Replacement:="0", LookAt:=xlPart,
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False,
ReplaceFormat:=False
End If
End If
Next ShapeObject
End Sub