Solved

Cannot find array

Posted on 2016-11-08
2
35 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
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

839 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