Property not found: DoCmd.TransferSpreadSheet

C

chris seiter

XP, Office 2007
I've got a table I need to export to Excel and the only solution I saw was
TransferSpreadsheet. Below is what I came up with(with help from the
Scripting Guys archives):

Sub Create_Excel_Export()
Dim strReportName As String
Dim strChooseLocation As String
Dim strLocationSave As String
Const acExport = 1
Const acSpreadsheetTypeExcel9 = 9
strReportName = Month(Date) & "-" & Day(Date) & "-" & (Right(Year(Date), 2))
& ".xls"
strChooseLocation = InputBox("Where would you like to save the report?",
"Save Location")
If Right(strChooseLocation, 1) = "\" Then
Else
strChooseLocation = strChooseLocation & "\"
End If
If InStr(1, strChooseLocation, " ", vbTextCompare) Then
strChooseLocation = Chr(34) & strChooseLocation & Chr(34)
Else
End If
strLocationSave = strChooseLocation & strReportName
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
"tbTemp_Table_From_qrToBeFilled3_Copy_By_Chris", strLocationSave, True
End Sub

It tells me that there is a "runtime 3270:property not found" error. I've
tried creating the excel spreadsheet ahead of time, and that doesn't work.
I've double checked spelling and everything is spelled correctly. What could
I be missing?
 
D

Deepti Jain

Hi,

I have migrated the database from Access 2003 to Access 2007.
I am exporting the data from Access Report to the Excel 2007.I am getting the Error while using the command which is mentioned below and the error is "Error 3270 Reserved Error"

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, QueryName, ReportFileName, True

It is prompting a widow while exporting the data and asking about the parameters for the report which is not having the records.If the record is there in the report it is exporting the data successfully.
Please advice.

Thanks & Regards,
Deepti Jain
 

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