Solved

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

Posted on 2016-10-28
4
27 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

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

7 Experts available now in Live!

Get 1:1 Help Now