Needed help badly.. for runtime error

kiwilife

Board Regular
Joined
Jul 21, 2005
Messages
66
Hi,

I have a question on a runtime error in powerpoint. As macros is a share language amoung excel and powerpoint thus i post my question here, hoping to get some help. I needed to make use of macros to do some checking. If the slideMaster do not have a footer, I will add in one. If not I will just ignore. I have a line of code to add in the footer in the master slide but i do not know how to check if footer exist in the slideMaster a not. If there is no footer the line of code will run well but if a footer is already exist, it wil show me a run-time error message as shown below. Does anyone know how to write macros to do a checking on the existance of the footer. Help will be greatly appreciated. Thanks in advance.

Run-time error - '2147188160(80048240)':

Shape(unknown member) : Invalid request. Slide already contains maximun placeholders of this type.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Here you go.

First cycle through the object to see if it is there. If not, add the footer.

<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> test()
<SPAN style="color:#00007F">Dim</SPAN> shp_x <SPAN style="color:#00007F">As</SPAN> Shape
<SPAN style="color:#00007F">Dim</SPAN> bln_Footer <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Boolean</SPAN>

    bln_Footer = <SPAN style="color:#00007F">False</SPAN>
    <SPAN style="color:#00007F">For</SPAN> <SPAN style="color:#00007F">Each</SPAN> shp_x <SPAN style="color:#00007F">In</SPAN> ActivePresentation.TitleMaster.Shapes.Placeholders
        <SPAN style="color:#00007F">If</SPAN> shp_x.PlaceholderFormat.Type = ppPlaceholderFooter <SPAN style="color:#00007F">Then</SPAN>
            bln_Footer = <SPAN style="color:#00007F">True</SPAN>
        <SPAN style="color:#00007F">Else</SPAN>
        <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN>
    <SPAN style="color:#00007F">Next</SPAN>

    <SPAN style="color:#00007F">If</SPAN> bln_Footer = <SPAN style="color:#00007F">False</SPAN> <SPAN style="color:#00007F">Then</SPAN>
        ActivePresentation.TitleMaster.Shapes.AddPlaceholder Type:=ppPlaceholderFooter
    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN>
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN>

</FONT>
 
Upvote 0

Forum statistics

Threads
1,224,847
Messages
6,181,326
Members
453,032
Latest member
Pauh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top