Solved

How to return reference to sheet1 in excel

Posted on 2015-02-24
8
80 Views
Last Modified: 2016-02-10
This spreadsheet was updated from MS Office 2012 to MS Office 2013.  Now code I used before sheet1.cells(5,2) comes back and tell me application-defined or object defined error.  So somewhere I lost a reference.   could someone please tell me how to get It back.  I cant seem to use sheet2.activate or anything referencing the sheets.

thanks
0
Comment
Question by:mgmhicks
8 Comments
 
LVL 33

Expert Comment

by:Norie
ID: 40628663
Can we see the rest of the code?
0
 
LVL 13

Expert Comment

by:Santosh Gupta
ID: 40628670
MS Office 2012 ??
0
 

Author Comment

by:mgmhicks
ID: 40628740
this doesn't work  sheet1.Cells(5, 2)

but this does work cells(5,2)
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

 
LVL 12

Accepted Solution

by:
FarWest earned 500 total points
ID: 40628751
it should  work!! can you see sheet1 in project explorer in code window?

make sure that you have at least those references in the project
excelref.jpgif still not working try this
dim sheet1 as worksheet
set sheet1 = activeworkbook.worksheets(1)

Open in new window

0
 

Author Comment

by:mgmhicks
ID: 40628766
I know right.  I have other worksheets that are just fine.  Here are my references.

References.png
0
 
LVL 12

Expert Comment

by:FarWest
ID: 40628815
I think references are fine
can you see sheet1 as this excelproj.jpg
0
 

Author Comment

by:mgmhicks
ID: 40629891
Yes, I do.   it does the same for other sheets within the same workbook.
0
 
LVL 12

Expert Comment

by:FarWest
ID: 40629980
Will you send me the file. You can remove any data inside but keep the sheets. And make sure that the problem still exists in the uploaded file
BTW did the code I gave you before solved the problem?
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
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.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

830 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