PC Review


Reply
Thread Tools Rate Thread

Adding date to outputted file name returning error.

 
 
=?Utf-8?B?Y2xlbQ==?=
Guest
Posts: n/a
 
      17th Oct 2006
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
 
Reply With Quote
 
 
 
 
James
Guest
Posts: n/a
 
      17th Oct 2006
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


 
Reply With Quote
 
=?Utf-8?B?Y2xlbQ==?=
Guest
Posts: n/a
 
      17th Oct 2006
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

>
>

 
Reply With Quote
 
James
Guest
Posts: n/a
 
      17th Oct 2006
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

> >
> >


 
Reply With Quote
 
=?Utf-8?B?Y2xlbQ==?=
Guest
Posts: n/a
 
      17th Oct 2006
Will try that. Thanks for your help

"James" wrote:

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

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sumifs with date range returning #VALUE error Derrick Microsoft Excel Discussion 5 25th Mar 2010 06:37 PM
Searching file system and returning xml based on date search crite Bryan Microsoft ASP .NET 0 11th Aug 2008 10:59 PM
SCANPST returning error - says it can't access file! Ariel Microsoft Outlook Discussion 1 27th Jun 2008 03:56 AM
ACCess Report outputted to HtML OCM =?Utf-8?B?QWtpcmE=?= Microsoft Access Reports 0 23rd Sep 2005 01:42 AM
Can reports be outputted into Lotus Notes? Tim Microsoft Access Reports 0 12th Jul 2004 02:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:53 AM.