Yeah so am I, not sure why. Have tested and this works in VBA though,
you could stick it behind a command button on one of your forms.
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
"TableName", _
"C:\Report" & Format(Date, "mmddyy") & ".xls", True
Sorry macros are not my area so possibly you are not allowed to use
functions like 'Format' in them.
James
clem wrote:
> Thanks very much for your reply James, however I am still getting "Cannot
> Update. Database or object is read only."
>
> "James" wrote:
>
> > Hi
> >
> > Have you tried:
> > "C:\Report" & Format(Date(),"mmddyy") & ".xls"
> >
> > James
> >
> > clem wrote:
> > > I am using a macro (transferspreadsheet) to export a report from access to
> > > excel. I require the outputted file to include todays date, so i have defined
> > > the file name as:
> > >
> > > C:\"Report"&Format(Date,"mmddyy") & ".xls"
> > >
> > > When I run the macro an error is displated:
> > >
> > > Cannot Update. Database or object is read only.
> > >
> > > If I run the macro without the date formatting (i.e.C:\Report.xls) it works
> > > OK. Anyone know a reason for this and how to fix.
> > >
> > > Thanks
> >
> >
|