Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have written some Excel vba code that is supposed to change the value of a text box in PowerPoint. I am using Excel 2002 and PowerPoint 2002 and the problem is that when I try and run the code it errors out and says : Run-time error '-2147188160 (80048240)' : TextFrame (unknown member ): Invalid request. This type of shape cannot have a text range. I am trying to update text within a rectangle - so could this be the reason my code of : oPPTApp.ActivePresentation.Slides(slide_no).Select With oPPTApp.ActivePresentation.Slides(slide_no) For Each oPPTShape In .Shapes If oPPTShape.TextFrame.TextRange.Text = find_text Then oPPTShape.TextFrame.TextRange.Text = replace_text ...... does not work? How else could I get around the problem of trying to update a rectangle with text within it? Many thanks KD |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Is it possible you have objects on the slide that do not have a textframe property, like a chart? Maybe use some error handling or test the shape type before trying to change the property. Cheers Andy KD wrote: Hi, I have written some Excel vba code that is supposed to change the value of a text box in PowerPoint. I am using Excel 2002 and PowerPoint 2002 and the problem is that when I try and run the code it errors out and says : Run-time error '-2147188160 (80048240)' : TextFrame (unknown member ): Invalid request. This type of shape cannot have a text range. I am trying to update text within a rectangle - so could this be the reason my code of : oPPTApp.ActivePresentation.Slides(slide_no).Select With oPPTApp.ActivePresentation.Slides(slide_no) For Each oPPTShape In .Shapes If oPPTShape.TextFrame.TextRange.Text = find_text Then oPPTShape.TextFrame.TextRange.Text = replace_text ..... does not work? How else could I get around the problem of trying to update a rectangle with text within it? Many thanks KD -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Thanks that seems to work now I've put a test in place - also how do I change the color of my new text, I am trying : oPPTShape.TextFrame.TextRange.Font.Color=38 and it does not appear to be working. Many thanks for your help KD -----Original Message----- Hi, Is it possible you have objects on the slide that do not have a textframe property, like a chart? Maybe use some error handling or test the shape type before trying to change the property. Cheers Andy KD wrote: Hi, I have written some Excel vba code that is supposed to change the value of a text box in PowerPoint. I am using Excel 2002 and PowerPoint 2002 and the problem is that when I try and run the code it errors out and says : Run-time error '-2147188160 (80048240)' : TextFrame (unknown member ): Invalid request. This type of shape cannot have a text range. I am trying to update text within a rectangle - so could this be the reason my code of : oPPTApp.ActivePresentation.Slides(slide_no).Select With oPPTApp.ActivePresentation.Slides(slide_no) For Each oPPTShape In .Shapes If oPPTShape.TextFrame.TextRange.Text = find_text Then oPPTShape.TextFrame.TextRange.Text = replace_text ..... does not work? How else could I get around the problem of trying to update a rectangle with text within it? Many thanks KD -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I assume the text appears black. You need to specify the color either using RGB or SchemeColor. oPPTShape.TextFrame.TextRange.Font.Color.RGB=RGB(2 55,0,0) ' Red oPPTShape.TextFrame.TextRange.Font.Color.SchemeCol or = 4 Cheers Andy KD wrote: Hi, Thanks that seems to work now I've put a test in place - also how do I change the color of my new text, I am trying : oPPTShape.TextFrame.TextRange.Font.Color=38 and it does not appear to be working. Many thanks for your help KD -----Original Message----- Hi, Is it possible you have objects on the slide that do not have a textframe property, like a chart? Maybe use some error handling or test the shape type before trying to change the property. Cheers Andy KD wrote: Hi, I have written some Excel vba code that is supposed to change the value of a text box in PowerPoint. I am using Excel 2002 and PowerPoint 2002 and the problem is that when I try and run the code it errors out and says : Run-time error '-2147188160 (80048240)' : TextFrame (unknown member ): Invalid request. This type of shape cannot have a text range. I am trying to update text within a rectangle - so could this be the reason my code of : oPPTApp.ActivePresentation.Slides(slide_no).Sel ect With oPPTApp.ActivePresentation.Slides(slide_no) For Each oPPTShape In .Shapes If oPPTShape.TextFrame.TextRange.Text = find_text Then oPPTShape.TextFrame.TextRange.Text = replace_text ..... does not work? How else could I get around the problem of trying to update a rectangle with text within it? Many thanks KD -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info . -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
link text box in powerpoint to a cell | New Users to Excel | |||
Changing link of a excel worksheet in powerpoint | Excel Discussion (Misc queries) | |||
PowerPoint Graph Size Changing | Excel Programming | |||
Changing the 3D-View in powerpoint using vba | Excel Programming | |||
Changing attributes of PowerPoint chart in vba | Excel Programming |