[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 87
  • Last Modified:

How to return reference to sheet1 in excel

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
mgmhicks
Asked:
mgmhicks
1 Solution
 
NorieCommented:
Can we see the rest of the code?
0
 
Santosh GuptaCommented:
MS Office 2012 ??
0
 
mgmhicksAuthor Commented:
this doesn't work  sheet1.Cells(5, 2)

but this does work cells(5,2)
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
FarWestCommented:
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
 
mgmhicksAuthor Commented:
I know right.  I have other worksheets that are just fine.  Here are my references.

References.png
0
 
FarWestCommented:
I think references are fine
can you see sheet1 as this excelproj.jpg
0
 
mgmhicksAuthor Commented:
Yes, I do.   it does the same for other sheets within the same workbook.
0
 
FarWestCommented:
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now