Question : Using access2007 runtime where target pc has office 2003

I am new to access so apologies for my ignorance.
i have developed a database for a society's membership.  everything works fine on my pc which is vista and office 2007.
i used access runtime to create a version to distribute to a couple of users.  this works fine on the pc i developed it on but when i install on another pc (which has office 2003)i get a number of errors:-
on loading i get
 Your database or project contains a missing or broken reference to the file EXCEL.EXE version 1.6
followed by
Your database or project contains a missing or broken reference to the file MSOUTL.OLB version 9.3
much of the application then works but if I try to use the part which creates an excel spreadsheet i get the message
Execution of this application has stopped due to a run-time error
i have read some threads which suggested checking the reference on the target pc but i cant do this because it is running a runtime version
i also saw threads suggesting using late binding. I did not fully understand these but i included the following lines in the sub which called excel
Dim oxl as Object
Set oxl = CreateObject("Excel.Application")
The code i am using to create the excel spreadsheet is
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qry_PrintMembershipCards", strExpFilePath, -1
The full code for one of the subs is attached.
i also have other problems where i have used Left and Format but i'll address them later
many thanks for your attention.  I hope someone can help me with this
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
Private Sub cmd_CreateMembershipCardFile_Click()
On Error GoTo Err_cmd_CreateMembershipCardFile_Click
 
'CREATE MEMBERSHIP CARD FILE
'LATE BINDING
Dim oxl As Object
Set oxl = CreateObject("Excel.Application")
 
'Create  file name
strExpFilePath = "c:\BBMA\PrintMembershipCards.xls"
 
'calculate number of records
Set db = CurrentDb
Set rst = db.OpenRecordset("qry_PrintMembershipCards", dbOpenSnapshot)
With rst
    If .RecordCount > 0 Then
        .MoveLast
        .MoveFirst
    End If
End With
NoOfCards = rst.RecordCount
 
'display number of Membership Cards to be created
Response = MsgBox("You are about to create " & NoOfCards & " records in file " & vbCr _
    & strExpFilePath & vbCr & " for use in the Print Membership Cards mail merge" & vbCr _
    & "ARE YOU SURE YOU HAVE ARCHIVED THE LAST FILE - THIS WILL OVERWRITE THE FILE IN C:\BBMA" & vbCr _
    & "click YES to go ahead or NO to cancel", vbYesNo)
If Response = vbNo Then Exit Sub
 
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qry_PrintMembershipCards", strExpFilePath, -1
 
'________________________________________
'UPDATE DATE CARD SENT SENT IN MEMBERS TABLE
'display number of records to be updated in Members table
Response = MsgBox("you are about to set the Date Membership Card Sent in the Members table for " & vbCr _
    & NoOfLetters & " New Members" & vbCr _
    & "click YES to go ahead or NO to cancel", vbYesNo)
If Response = vbNo Then Exit Sub
 
'run query to update date  first reminder Sent in Members table
    Dim QueryName As String
    QueryName = "qry_UpdateAfterMembershipCardSent"
    DoCmd.OpenQuery QueryName, acNormal, acEdit
'____________________________________________
 
 
Exit_cmd_CreateMembershipCardFile_Click:
    Exit Sub
 
Err_cmd_CreateMembershipCardFile_Click:
    MsgBox Err.Description
    Resume Exit_cmd_CreateMembershipCardFile_Click
    
End Sub

Answer : Using access2007 runtime where target pc has office 2003

When you use Late Binding (and you've got the general idea), you can then remove that reference from your database. Late Binding allows VBA to use whatever version of the library is currently installed on the machine. So if you move your database from a machine with Excel 10.0 to a machine with Excel 12.0, Late Binding will use the 12.0 library to make your calls.

Once you resolve your reference errors, the issues with things like Left and Mid will go away.

You should also compile you application before shipping to insure that you've fixed everything. From the VBA editor window, click Debug - Compile and fix any errors that show up.

In addition, you must be VERY careful when installing the Access Runtime on a PC with an existing full version of Access. You can really muck things up if you don't handle this properly. Sagekey software (www.sagekey.com) is a firm that came into existence specifically to handle this sort of thing. When you fire up 2007, it "registers" itself on the machine as the default application to handle all .mdb/.mde/.accde/.accdb files ... this is all fine and well when dealing with YOUR app, but when users then go to another Access application and doubleclick it to run, then the 2007 runtime opens ... not exactly what your users expect to see! The fix is to ALWAYS launch ALL applications from a shortcut, but of course that is a difficult task (at best) for machines with existing Access apps. The Sagekey scripts work by launching your application using a separate executable that (a) stores all the current info about the currently registered Access version, (b) registers 2007 on the machine, (c) fires up your app and then, when you close it (d) de-registers your app and re-registers the previously registered version. IMO, it's the only way to deploy the Access runtime if you want to avoid a lot of very nasty support calls.
Random Solutions  
 
programming4us programming4us