#  Other Applications & Softwares  > PowerPoint Formatting & General >  >  Error - To select a shape its view must be active

## Yogev

Hello everyone

I wrote a code to reposition images in the PPT slide by selecting from a list.
To select from a list I use Combo box.
The problem is that I get the error after I select from the list.

I would appreciate if anyone could help me.

Below is the code:


Private Sub ComboBox1_Change()

ComboBox1.List = Array("Increase", "Reduction", "No change", "Empty")

ComboBox1.ListRows = 4

If ComboBox1.Value = "Reduction" Then

 ActivePresentation.Slides(1).Shapes.Range(Array("Wshape")).Select
 Selection.ShapeRange.ZOrder msoBringToFront


 ActivePresentation.Slides(1).Shapes.Range(Array("neutral")).Select
 Selection.ShapeRange.ZOrder msoBringToFront

 End If

If ComboBox1.Value = "Empty" Then

 ActivePresentation.Slides(1).Shapes.Range(Array("Wshape")).Select
 Selection.ShapeRange.ZOrder msoBringToFront


 ActivePresentation.Slides(1).Shapes.Range(Array("Wshape")).Select
 Selection.ShapeRange.ZOrder msoBringToFront

 End If

If ComboBox1.Value = "No change" Then

 ActivePresentation.Slides(1).Shapes.Range(Array("Wshape")).Select
 Selection.ShapeRange.ZOrder msoBringToFront


 ActivePresentation.Slides(1).Shapes.Range(Array("MEDIUM")).Select
 Selection.ShapeRange.ZOrder msoBringToFront

 End If

If ComboBox1 = "Increase" Then

 ActivePresentation.Slides(1).Shapes.Range(Array("Wshape")).Select
 Selection.ShapeRange.ZOrder msoBringToFront


 ActivePresentation.Slides(1).Shapes.Range(Array("HIGH")).Select
 Selection.ShapeRange.ZOrder msoBringToFront

End If

End Sub

----------


## Andy Pope

*Administrative Note:*

Welcome to the forum.  :Smilie: 

We would very much like to help you with your query, however you need to include code tags around your code.

Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the *#* icon at the top of your post window. More information about these and other tags can be found here

(*Note:* this change is not optional. No help to be offered until this moderation request has been fulfilled.)

You do not need to select it. And if it is a single shape no need for shaperange. Just use the Shapes collection.



```
Please Login or Register  to view this content.
```

----------


## albenze121

i just tried thise method it's 100% work.
                                 thank you

----------

