[AccessD] A2010 packager

Gustav Brock gustav at cactus.dk
Wed Apr 16 16:58:42 CDT 2014


Hi Rocky

I think you have drifted away from the safe method to automate Excel which has been posted here so many times:
Here's the order to open and close Excel:

    Dim xls     As Excel.Application
    Dim wkb     As Excel.Workbook
    Dim wks     As Excel.Worksheet
    
    Set xls = New Excel.Application
    Set wkb = xls.Workbooks.Open("c:\test\workbook1.xlsx")
    Set wks = wkb.Worksheets(1)
    
    ' Do stuff.
    wks.Name = "My New Name"
    wkb.Close True
    
    Set wks = Nothing
    Set wkb = Nothing
    
    xls.Quit
    
    Set xls = Nothing

You _MUST_ be very specific to this. If you set your xlApp to Nothing, its feet are kicked away.
Also, Sheets are not identical to WorkSheets.

This method is valid for Outlook as well I guess, but I have never used Outlook this way.

/gustav 
________________________________________
Fra: accessd-bounces at databaseadvisors.com <accessd-bounces at databaseadvisors.com> på vegne af Rocky Smolin <rockysmolin at bchacc.com>
Sendt: 16. april 2014 20:38
Til: 'Access Developers discussion and problem solving'
Cc: 'Off Topic'
Emne: [AccessD] A2010 packager

Dear List:

I am trying to create a runtime A2010 app which was converted to an accdb
from an mdb.  When I install the runtime (using a clean VM - only W7) it
won't start but tells me I'm missing Excel.exe.  I do have the references
set in the accdb to Microsoft Excel 14.0 Object Library.

The only place in the code where Excel appears is:

Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet

and then

    Set xlBook = GetObject(Me.txtBidsJobsSpreadsheet)
    Set xlApp = xlBook.Parent
    Set xlSheet = xlBook.Sheets(1)

I also use Transferspreadsheet:

    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
"qryClientSearchCounts", _
        gstrFrontEndPath & "ClientSearchCounts-" & Format(Date, "mmddyyyy"),
True
        MsgBox "Client Search Counts Exported To: " & gstrFrontEndPath &
"ClientSearchCounts-" & Format(Date, "mmddyyyy")

but all acSpreadsheetTypeExcel9 and that probably wouldn't make any
difference until it executes, if then.

I'm also getting a similar message about an outlook dll - same sort of
thing:

Dim myolApp As Outlook.Application
Dim myItem As Outlook.MailItem

and

    Set myolApp = CreateObject("Outlook.Application")
    Set myItem = myolApp.CreateItem(olMailItem)

I have the reference set to Outlook 14.0 object library.

Is anyone familiar with the workings of the runtime packager and know why
I'm getting these missing references?


MTIA

Rocky Smolin
Beach Access Software
858-259-4334
www.bchacc.com <http://www.bchacc.com/>
www.e-z-mrp.com <http://www.e-z-mrp.com/>
Skype: rocky.smolin


More information about the AccessD mailing list