Solved

How to return reference to sheet1 in excel

Posted on 2015-02-24
8
79 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
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…

773 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