Database or object is read-only

G

Guest

I am trying to run this:
Function TESTPPS()
Dim temp1 as string
temp1="T:\CLEARWIN\COACANCELS\PPS\PPS_TEST.CSV"
DoCmd.Transferspreadsheet acExport, , 'PPS_CANCELS", temp1, true
End Function

Why does this give me the error : "Database or Object is read-only"
Scott
 
J

John Nurick

Hi Scott,

The probably reason is that you have used a file extension (CSV) that
specifies a text file with a VBA method (TransferSpreadsheet) that
creates an Excel worksheet. You must either use TransferText to create a
CSV file, or pass an XLS filename to TransferSpreadsheet.
 
G

Guest

Hi John, your are right. I changed the .CSV to .XLS and it worked perfectly.
It seems that the command SET WARNINGS off suppress the error.

Next question:
Here is the command.
DoCmd.TransferText acImportDelim, "standardCSV", "PPS_CANCELS", temp1, True

How do you make "StandardCSV"?
I am looking but as of right now I can't find the wizard that the help file
mentioned.
Is there a default format that makes a “CSV†file?

Scott
 
G

Guest

I got it. thanks for your time John.

Scott Burke said:
Hi John, your are right. I changed the .CSV to .XLS and it worked perfectly.
It seems that the command SET WARNINGS off suppress the error.

Next question:
Here is the command.
DoCmd.TransferText acImportDelim, "standardCSV", "PPS_CANCELS", temp1, True

How do you make "StandardCSV"?
I am looking but as of right now I can't find the wizard that the help file
mentioned.
Is there a default format that makes a “CSV†file?

Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top