Solved

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

Posted on 2016-10-28
4
41 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
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.

792 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