Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hard coding time and date into Excel 2 28
Boolean help 6 27
ADD New Entries 7 15
Excel VBA Conceal connection string for SQL 9 13
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

932 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

8 Experts available now in Live!

Get 1:1 Help Now