Solved

Cannot find array

Posted on 2016-11-08
2
38 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
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…

756 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