Rocky Smolin
rockysmolin at bchacc.com
Wed Apr 16 23:07:15 CDT 2014
Gustav: I'll change the order as you recommend but It's not that code that it the problem (I don't think) because it never gets that far. It's working fine as a 2003 mdb and mde, and a 2010 accdb and accde with Office. The 2003 mde of my manufacturing package which I distributed as a run time for years did not require excel to automate. I can't figure out why this new app won't behave the same. r -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, April 16, 2014 2:59 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] A2010 packager 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 -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com