Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sorting references for outlook and excel

Status
Not open for further replies.

Genie78

MIS
Aug 11, 2008
18
GB
Hi there my Db is working fine till someone with old versions of excel or outlook use it. is there some code that i can add to auto exec or some such that will check for missing references and auto correct them?

This is proving a nightmare.. Just when one problem is solved.....
 
If you deploy your app in an heterogenous msoffice environment I'd suggest you yse late binding.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I'm not sure what late binding is and the few pages that have this are not overly clear?
 
This is an example of late binding. It is declared as an object, then set to the Excel Application. You don't need to have a reference to Excel.

Dim oExcel As Object
Dim bRunning As Boolean
bRunning = True
On Error Resume Next
Set oExcel = GetObject(, "Excel.Application")
If oExcel Is Nothing Then
Set oExcel = CreateObject("Excel.Application")
bRunning = False
End If
Err.Clear
 
So you would add this into a module would you then attach it to a macro etc?
 
Hi there sorry to ask this but once i have added this to a module do i then need to add this to a macro or another module.
 
You need to change the declaration any place in your code that you are using Outlook or Excel, so everywhere you have, say:

Dim ws As Worksheet

Change it to:

Dim ws As Object

And so on.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top