Solved

Dev in Excel 2016 - but problems in Excel 2010 (Option Explicit)

Posted on 2016-10-28
4
45 Views
Last Modified: 2016-11-01
I developed an Excel VBA application in Excel 2016, to be deployed for running in Excel 2010.

In Excel 2010 I get an error "Can't find project or library"

On looking into this I find that ...
Excel 2010 seems to default to Option Explicit. Although I should (!) I have not declared all my variables. How can I turn Option Explicit on?

BUT more interestingly ....!
When I go to the IDE and look in Tools, References is greyed out. So I can't even check if any component is 'missing'.

What's going on here?
Thanks
0
Comment
Question by:hindersaliva
  • 2
  • 2
4 Comments
 

Author Comment

by:hindersaliva
ID: 41863758
Got more info!

I created a small Excel 2016 test of minimal code getting data from an Access 2016 db via ADO. On this it does not mind variables not being declared AND I can get into Tools > References.

This is rather puzzling!
Any thoughts welcome.
0
 
LVL 33

Assisted Solution

by:Norie
Norie earned 500 total points
ID: 41863777
When you goto Tools>References... and it's greyed out is there any code being executed or anything else going on.

By the way, Option Explicit is not default in Excel 2010 (or any other version that I've used) and I doubt Option Explicit is the cause of the problem anyway.
0
 

Author Comment

by:hindersaliva
ID: 41863783
Haaaaaaa!

Yes. The 'greyed out' because I was in break mode. Doh!

The reason I getting an 'Option Explicit' mystery (and yes I thought so too Norie, re. it being a default as I had never come across that in my 2010 days) .... I had 'Missing Outlook 2016 Library'. But oddly the code I was running had no need to use that library! So it's still a mystery though I think I'm on my way to clearing this.

In short, I need select the Outlook 2010 Library in Tools > References. Did that and it works.
0
 
LVL 33

Accepted Solution

by:
Norie earned 500 total points
ID: 41863831
That should fix it but if you are going to develop across versions I would recommend developing in the earliest version and/or using late binding.
0

Featured Post

Industry Leaders: 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!

Question has a verified solution.

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

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Use Windows Task Scheduler to print a Word document weekly so your printer ink won't dry out.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

749 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