Solved

Cannot find array

Posted on 2016-11-08
2
19 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
Comment Utility
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
Comment Utility
Exactly what I suspected, but I needed some confirmation. Thank you!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Modern/Metro styled message box and input box that directly can replace MsgBox() and InputBox()in Microsoft Access 2013 and later. Also included is a preconfigured error box to be used in error handling.
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now