Solved

Cannot find array

Posted on 2016-11-08
2
42 Views
Last Modified: 2016-11-08
I have received a workbook to debug.  Execution of the code stops on the following line with the error message it cannot be found.
ActiveSheet.Shapes.Range(Array("HomeLay")).Select

Below is a list of all shapes on the active page.
Shape Name      Shape Type
Group 125      Group 125
Group 126      Group 126
Group 127      Group 127
Group 128      Group 128
Picture 1      Picture 1
TextBox 102      TextBox 102
Picture 34      Picture 34
TextBox 33      TextBox 33

Any idea what is going on here?
0
Comment
Question by:rrhandle8
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 500 total points
ID: 41879758
The code you have provided is attempting to select a range of one shape with the name of "HomeLay". If there are no shapes named that then you will get the error you reported. The Shapes.Range method typically is used to select multiple shapes by specifying the name of each in the Array function...

ActiveSheet.Shapes.Range(Array("Group 125", "Group 126", "Picture 1")).Select

Open in new window


Incidentally, this line...

ActiveSheet.Shapes.Range(Array("HomeLay")).Select

Open in new window


...performs the same action as this...
ActiveSheet.Shapes.("HomeLay").Select

Open in new window

0
 

Author Closing Comment

by:rrhandle8
ID: 41879768
Exactly what I suspected, but I needed some confirmation. Thank you!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Use Windows Task Scheduler to print a Word document weekly so your printer ink won't dry out.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question