Rocky Smolin at Beach Access Software
rockysmolin at bchacc.com
Tue Mar 17 17:26:34 CDT 2009
Yes, that works David. Thanks. But why? Or why not the other? Rocky Smolin Beach Access Software 858-259-4334 www.e-z-mrp.com www.bchacc.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David McAfee Sent: Tuesday, March 17, 2009 3:09 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] TrasnferSpreadsheet failing Rocky, does this work for you? Dim strOutPutFile As String strOutPutFile = Me.Application.CurrentProject.Path & "\ExportedMailingList.xls" DoCmd.OutputTo acOutputQuery, "qryExportMailingList", acFormatXLS, strOutPutFile, True I usually trap for error 2302 in my error handler and inform them with a messagebox: ElseIf Err.number = 2302 Then MsgBox "Unable to export to Excel file. Make sure you do not currently have that file open", , "Unable to export" I don't know what 3027 is. It could be similar. HTH David 2009/3/17 Rocky Smolin at Beach Access Software <rockysmolin at bchacc.com> > Dear List: > > > > I am trying to export data from a query to a spreadsheet. > > I get the error 3027 Cannot update. Database or object is read only. > > The line is: DoCmd.TransferSpreadsheet acExportDelim, > acSpreadsheetTypeExcel9, "qryExportMailingList", varFileName, True > > varfilename has the full path, name and extension. > > > > Any ideas what I'm doing wrong? > > > > MTIA > > > > Rocky Smolin > > Beach Access Software > > 858-259-4334 > > www.e-z-mrp.com <http://www.e-z-mrp.com/> > > www.bchacc.com <http://www.bchacc.com/> > > > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com