RE: Error using vba

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



If you have not renamed it the name is probably TextBox19 (no space)

I would rename to something more useful in the selection / visibility pane
though
--
john ATSIGN PPTAlchemy.co.uk

Free PPT Hints, Tips and Tutorials
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html






"Wayne" wrote:

I am new at VBA and trying to use VBA in powerPoint 2007 in a vista os
to create a quiz. I am reading a set of question into an array of
questions from a file and want to add one question at a time to a text
box. I am using the following code:
ActivePresentation.Slides(5).Shapes("TextBox
19").TextFrame.TextRange.Text = question(number)

but I have been getting the following error:

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

Item TextBox 19 not found in the Shapes collection.

But when I check the object code using either the selection and
visibility option in powerPoint or the code from example 8 from David
Marcovitz

Public Sub GetObjectName()
If ActiveWindow.Selection.Type = ppSelectionShapes _
Or ActiveWindow.Selection.Type = ppSelectionText Then
If ActiveWindow.Selection.ShapeRange.Count = 1 Then
MsgBox (ActiveWindow.Selection.ShapeRange.Name)
Else
MsgBox ("You have selected more than one shape.")
End If
Else
MsgBox ("No shapes are selected.")
End If
End Sub

I get that the object name is TextBox 19.

Please Help
.

.



Relevant Pages

  • Re: Writing into a textbox without interfeering with the users cursor ?
    ... big-enough problem to re-think till just recently. ... textbox to an exact character position. ... This (being able to scroll thru the text) is actually the most important ... It should have had the effect of preserving the selection. ...
    (microsoft.public.win32.programmer.ui)
  • RE: Combo box based on another combo but repeats initial input
    ... Set the textbox value on your main form in the popup combo's AfterUpdate ... selection to a textbox on your form. ... WorkType and next a WorkCode. ... Now when I fill in the first record, a second record is immediately created ...
    (microsoft.public.access.forms)
  • Re: Multiple selections in a list box
    ... If this is an unbound textbox you would probably want to do this in the ... >> single string like this. ... >> be better off creating a new row in a related table for each selection. ... >> Sandra Daigle ...
    (microsoft.public.access.forms)
  • Re: Need VBA Help with AddTextbox
    ... Try not to program using the selection functions. ... Why are you scaling the textbox? ... I don't know if anyone is using locked aspect ratios. ...
    (microsoft.public.powerpoint)
  • Re: Multiple selections in a list box
    ... >If this is an unbound textbox you would probably want to ... >To avoid the runtime error with null just modify the last ... >Sandra Daigle ... >> EVERY OTHER record retains that selection. ...
    (microsoft.public.access.forms)