zxmon21
02-26-2012, 03:37 PM
Hi board,
I write VBA code every now and then and can't seem to beat the following error message
"Runtime error 438 - Object doesn't support this property or method"
Here's the code where the error occurs:
Public Sub PutAllChapterIntoPlaceholder()
Dim RunSld As Slide
For Each RunSld In ActiveWindow.Selection.SlideRange
Debug.Print RunSld.Name
Debug.Print ReturnChapterPlh(RunSld).Name
PutChapterIntoShape (RunSld) '<-- The error occurs here
Next RunSld
End Sub
My guess is that I'm making a mistake calling or defining the PutChapterIntoShape sub. At the same time, ReturnChapterPlh works just as expected.
Here's the code for those two sub/functions
Public Sub PutChapterIntoShape(sld1 As Slide) '<-- This does not start
End Sub
Public Function ReturnChapterPlh(sld As Slide) As Shape
.... stuff gets done here .....
Set ReturnChapterPlh = ChapterPlh
End Function
Can someone point me to what I'm doing wrong with the sub that throws error 438 when I call it?
Thank you very much in advance!
I write VBA code every now and then and can't seem to beat the following error message
"Runtime error 438 - Object doesn't support this property or method"
Here's the code where the error occurs:
Public Sub PutAllChapterIntoPlaceholder()
Dim RunSld As Slide
For Each RunSld In ActiveWindow.Selection.SlideRange
Debug.Print RunSld.Name
Debug.Print ReturnChapterPlh(RunSld).Name
PutChapterIntoShape (RunSld) '<-- The error occurs here
Next RunSld
End Sub
My guess is that I'm making a mistake calling or defining the PutChapterIntoShape sub. At the same time, ReturnChapterPlh works just as expected.
Here's the code for those two sub/functions
Public Sub PutChapterIntoShape(sld1 As Slide) '<-- This does not start
End Sub
Public Function ReturnChapterPlh(sld As Slide) As Shape
.... stuff gets done here .....
Set ReturnChapterPlh = ChapterPlh
End Function
Can someone point me to what I'm doing wrong with the sub that throws error 438 when I call it?
Thank you very much in advance!