MS Access Missing References
I'm a C#.Net developer and haven't done VBA in a long time, so forgive my ignorance.
I have an Access 365 app from a client and I'm trying to work on it off site. I have Office 2013. When I open the app I get the error "Can't find project or library" on this line:
Code:
Dim appOutlook As Outlook.Application
If I uncheck the missing references won't this break the code once it's back at the client site? Again , they're referencing Office 365.
In the references list I'm missing:
- Microsoft Office Outlook 16.0 Object Library
Microsoft ActiveX Data Objects 2.0
Microsoft Office Excel 15.0 Object Library
Microsoft Office 15.0 Object Library
1) If I remove these references, won't that break things back on the the client's site?
2) How do you normally handle a situation like this?
Thank you
Re: MS Access Missing References
Welcome to the Forums.
This is what happens when you use Early Binding and lock your application in to a particular version of another application. If you remove the references yes it will break.
Usually if you have to support multiple versions of, Outlook for example, you would use Late Binding and use only the features that are common to all the needed supported versions.
Re: MS Access Missing References
Quote:
Originally Posted by
RobDog888
Welcome to the Forums.
This is what happens when you use Early Binding and lock your application in to a particular version of another application. If you remove the references yes it will break.
Usually if you have to support multiple versions of, Outlook for example, you would use Late Binding and use only the features that are common to all the needed supported versions.
I understand and completely agree.
I'm just getting started, so I don't yet know what functionality is required from each reference. If they're referencing Outlook just to send an email, that can be accomplished with most Outlook references. Same for reading/writing from Excel.
Sounds like there needs to be code that check for a specific version of each DLL.
Re: MS Access Missing References
Quote:
that can be accomplished with most Outlook references
yes but if you change the reference version to run on your machine, it will not run on theirs when you take it back, you can not change the reference back except on a machine with the required version installed
to use late binding
remove all references to office applications
Quote:
Dim appOutlook As Outlook.Application
change all msoffice type variables to type object
replace all instances like set appOutlook = new outlook with set appoutlook = createobject("outlook.application") appropriate to the application required
make sure all office constants are declared or use their literal values, else they may default to 0
see the thread at the top of this forum for the tutorial on automating office applications
the project should then run on your machine and still run when you take it back
there maybe some lines the may fail, on your machine, as they use properties or methods, only valid in later versions, not much you can do about those in your earlier versions
the only other option, that i would hate to recommend, is to upgrade your office to a later version