Solved

Access DB created with vba code/reference update?

Posted on 2004-08-03
8
552 Views
Last Modified: 2010-10-20
Hi everyone I have made a Access DB and have several forms with vba code, I have made a MDE file but wanted to know because all the refereneces (word and excel) are linked to office 2003 applications will this database work with older office 2000 or xp applications? such as excel and word? and when the new microsoft applications will come out will these references still work - will they upgrade themselves? or would i have to go to the mdb file and do it myself?
0
Comment
Question by:eazy123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
8 Comments
 
LVL 34

Expert Comment

by:flavo
ID: 11701343
If you use early binding then no.

You'll need to use late binding. (its slower though)

You dont need refrences for this, so get rid of them

Example usage

Dim objExcel as object

Set objExcel = CreateObject("Excel.Application")

0
 
LVL 34

Accepted Solution

by:
flavo earned 125 total points
ID: 11701354
I had a similar Q today, heres one of my comments

Early v late binding:

Early binding
- Need to add a refrence (Tools - refrences)
- Faster
- Will fail if the exact refrence (dll) is not on the pc
- use like Dim xl as Excel.Application
             Set xl = New excel.application

Late Binding
- slower
- No refrences (tools - refences)
- Will work on for example Excel 97 if you develop on Excel 2000 (if same properties / methods were present)
- Use like - Dim xl as object
                set xl = createobjecy("excel.application")
0
 
LVL 34

Expert Comment

by:flavo
ID: 11701370
It is one of the problems from using early binding.  

I generally code everything up firstly with early binding so i get the IntelSense working, then once its all tested and debuged, change it to late binding just incase.

Dave
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:eazy123
ID: 11701383
how do i change it to late binding?
0
 
LVL 34

Expert Comment

by:flavo
ID: 11701459
Take away the refreces to Excel and word (leave Access)

Then replace anything that says

Dim xl as Excel.Appication

with

Dim xl as Object

and replace anything with

Set xl = New Excel.Application

with

Set xl = CreateObject("Excel.Application")

Dave
0
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 125 total points
ID: 11703298
Actually, Access is USUALLY "intelligent" enough to update references ... for example, I use Excel 2000 on one dev computer, and most of my clients use 2002 ... if I make a reference to Excel 2000 on that laptop, build an .mde, and deploy it to their machine (with Excel 2002 installed), the .mde file will automatically re-reference to the  Excel 2002 library ...

However, you'll notice I said "usually" ... I'd not trust that in a distributed app, and would instead follow Dave's advice re" Late Binding (for more info, search on CreateObject in online help and Google) and check out Mitch Kaplan's site for the most comprehenisve look at this technique:

http://www.trigeminal.com/usenet/usenet026.asp

Terry Kreft's Ref Wizard:
http://www.mvps.org/access/modules/mdl0022.htm

The biggest concern in your environment is that you NOT use version-specific items (for example the Printer object in 2003, which is NOT available downstream) ... if you do this, your code WILL fail. Even if you develop in the 2003 environment with the default 2000 format, you can still use features of 2003 which may not be available downstream ...
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

738 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