[AccessD] TrasnferSpreadsheet failing

David McAfee davidmcafee at gmail.com
Tue Mar 17 17:09:04 CDT 2009


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
>
>



More information about the AccessD mailing list