Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Changing Text in PowerPoint

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Changing Text in PowerPoint

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Changing Text in PowerPoint

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Changing Text in PowerPoint

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
link text box in powerpoint to a cell GENO New Users to Excel 2 April 4th 23 11:40 AM
Changing link of a excel worksheet in powerpoint Soumyadip Excel Discussion (Misc queries) 0 April 17th 09 04:50 PM
PowerPoint Graph Size Changing Sean Howard Excel Programming 0 August 4th 04 11:52 AM
Changing the 3D-View in powerpoint using vba KD[_3_] Excel Programming 0 July 2nd 04 12:05 PM
Changing attributes of PowerPoint chart in vba KD[_3_] Excel Programming 0 May 17th 04 10:41 AM


All times are GMT +1. The time now is 02:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"