Problem with Office Libraries

I have a database application developed in access 10.  The application has a problem where Stop and breakpoints in the code don't work.  Following previous EE advice from having this problem before, I created a new database and imported everything except the linked tables.  The new database would not compile.  

The original database referenced Microsoft Office 14 Object Library.  The new database can't reference this library.  It only has Office 15 Object Library.  The new database does not compile with the Office 15 library.  (It errors on application.properties.)

Can anyone tell me:

1.  Why the Office 14 Object Library is not available in the new database?

2.  The file name and location of the Office 14 library so that I can browse to it and reference it.  (The little reference dialog box is too small to show the entire path.)

Thanks in advance.
Clive BeatonAccess DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

John TsioumprisSoftware & Systems EngineerCommented:
With this plugin you will see the "light"
DrTribosCommented:
@ John - I'm assuming your link relates to question #2?

@ CRB1609 - When you say Stop and BreakPoints don't work, what exactly do you mean?  If you decompile the project and rebuild they may start working again.

As for the references... well would you be able to do this with late binding instead?
John TsioumprisSoftware & Systems EngineerCommented:
@DrTribos you are correct...i wrote my answer in a bit of a hurry....
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

DrTribosCommented:
@ JT - No worries, I had not heard of that plug-in before (I use MZ-Tools) and was wondering if it had a decompiler... I concluded it did not but thought I'd ask all the same.
Clive BeatonAccess DeveloperAuthor Commented:
Thank you both for your responses.

@ DrTribos - In answer to question 2.  I have a Msgbox at the start of a function, followed by a Stop, and I set a breakpoint on the next line of code.  When I run the code, I get the msgbox but the code does not stop on the Stop or the breakpoint.

As for the references, late binding is well beyond my skill level.

@ John - Are you still recommending the plugin?  (I also use MZ-Tools)
DrTribosCommented:
@CRB - no mate, you can do it!  I once thought late binding was black magic (actually I still do think that) but it is easy enough to follow the pattern...

Drawback is that you can not use intellisense
Advantage is that you don't have to worry (as much) about versions

Basic Pattern is:
Declare an object (e.g. instead of the actual thing)
Instantise the object as the actual thing

BTW from what you are saying about the breakpoints a decompile will help, I've not seen your specific issue - I tend to see it in reverse, i.e. my code breaks for absolutely no reason.

Re. seeing the light.  I think John would still recommend as the plugin allows you to see complete paths for the Reference libs...
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Office 14 = Office 2010, so it appears you're developing in 2013 (which is Office 15). You cannot change that reference, even if you could find the correct libraries, and you should not use late binding to try and get around that.

Instead, determine why the application is faulting, and go from there. Often when you have issues like you describe it's because some other reference is bad, and the fact that you cannot compile would support that.

Open the References dialog let us know the items that are listed there, and we can help.

Next - can you let us know the line where your Compile options stops?
DrTribosCommented:
@Scott,  I should have been clearer - I was suggesting late binding to overcome this aspect of the OP:
Can anyone tell me:

1.  Why the Office 14 Object Library is not available in the new database?

But, I think your comment about not using late binding relates to this aspect?
The new database does not compile with the Office 15 library.  (It errors on application.properties.)

I totally agree that the compile error should be addressed (and an example provided), but  admit that it's all dark magic to me. I thought it would be generally safe to assume that 15 would be backward compatible so code that works in 14 would always work in 15; apparently not the case for the OP?!

I may have misunderstood your comment (specifically the bit in bold):
Office 14 = Office 2010, so it appears you're developing in 2013 (which is Office 15). You cannot change that reference, even if you could find the correct libraries, and you should not use late binding to try and get around that.

[Edit1: just dawned on me that this is a core lib - guessing that is the main reason to avoid late binding?]

Personally not wanting to give bad advice, I'd like to clear thing up a bit.  So leaving the compile error aside, can you confirm if you would avoid late binding in this situation; and if so why, and would you ever recommend or use late binding?  

I use late binding to open Excel from Word - as far as I can tell this is recommended by a lot of Word MPVs and seems to work well.  

[Edit2: I'm guessing that if this was created in 2010 then run in 2013 it would still crash in 2013?  If that is the case could the issue be related to 32 -> 64 bit (and not a difference in the lib itself)?]
Clive BeatonAccess DeveloperAuthor Commented:
Experts,

Thank you all for your continued assistance with my problem.

@DrTribos - I have decompiled and recompiled a number of times.  (BTW my code also breaks for absolutely no reason.)  I installed the plugin and it was very useful, especially with the references window.

@Scott
1. definitley not developed in 2013.  I don't even have it installed.

2. The code is attached:
I get both msgboxes but execution does not stop.

3.   Attached is the references Window for a brand new database created in access 2010, showing a rference to Office 15 .
The-Code.JPG
Database4.JPG
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
just dawned on me that this is a core lib - guessing that is the main reason to avoid late binding?]
Exactly. You should never use Late Binding for that reference, since it "points" to the environment in which the code is running, and trying to override that would cause a world of troubles.

I would most definitely recommend using Late Binding for other libraries, like Word, Excel, etc. This allows your code to work against the currently installed version of that application on the target machine, and as long as you don't use any features specific to a version you stand a much, much better chance of success.

Just don't use Late Binding on those core references, like "Visual Basic for Applications", "OLE Automation", etc.

CRB1609:

The reference you're showing is most definitely the 2013 library, although you're also showing that you're running this in 2010 (the "14" reference). I assume that is the cause of your compile error, and the errors you get when running the application.

If Access is creating those references when you create a NEW database in 2010, then somethings wrong with your installation of Office or Windows.

When I create a new db in 2010, I get refs to the "14" libraries.

When I create a new db in 2013, I get refs to the "15" libraries.

Is it possible the 2013 Runtime is installed somewhere? Your machine must be picking that up from somewhere. See if you can find the file identified by that reference, and let us know where it's located.

As a possible fix, first make sure that Office and Windows are fully up to date. If that doesn't work, I'd try a repair install of Office first, but I'm guessing that you'll have to do a complete uninstall/repair of Office.
DrTribosCommented:
Thanks for the clarification, shone a little more light on this dark magic!
Clive BeatonAccess DeveloperAuthor Commented:
@Scott -
1.  Using John's plugin, I found that Microsoft Office 14 refers to MSO.DLL.  
2.  I have OFFICE 15 folders in both Program Files and Program Files (x86).  
3.  I didn't knowingly do anything to put them there.
4.  Microsoft Office 15 is not installed.
5.  I can create a database and manually change the reference to the OFFICE 14 dll, but the following line gives a complie error:      db.Properties!AppTitle = "CA Development"

I am tempred to delete all folders/subfolders of OFFICE 15, but I thought I would run it by you, first.

Thanks.

Clive
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Sounds as if something like the Access Runtime was installed, or something of that nature. Use the Add/Remove Programs applet and see if you find anything that refers to Access 2013 (or later), and uninstall it. Of course, this could have an impact on other programs, if they depend on that runtime, so be sure you want to do this before proceeding.

Short of that, it would sound like my earlier suggestion of a repair/reinstall would be the way to go. Deleting those directories would very likely only cause more troubles.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Clive BeatonAccess DeveloperAuthor Commented:
Thank you very much.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.