Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error trying to export access to excel 1

Status
Not open for further replies.

bdjb

Technical User
Oct 29, 2002
292
US
I'm using Access XP, and trying to export a table to a .csv file using vba. I get the error "Run-Time error 3027, Cannot update, database or object is read only". Here's the code I'm using:
Option Compare Database
Public Sub Get_Input()

Dim strMsg As String
Dim Path As String

strMsg = "Enter the Fiscal Year and Fiscal Month in the format YYMM"
strInput = InputBox(strMsg)

'Change the path below to the live path
strPath = "C:\nfslawson\" & strInput & ".VAPGLTRANS.csv"

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, _
"AP_Query_Export", strPath, True
End Sub

What happens if you get scared half to death twice?

Bob
 
Why not using the DoCmd.TransferText (with acExportDelim) method for creating a .csv ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PH, I'm just learning VBA, and transferspreadsheet was the method I was pointed at. Transfer text worked just great!

What happens if you get scared half to death twice?

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top