rsbutterfly16
Registered User.
- Local time
- Today, 01:08
- Joined
- Jun 5, 2006
- Messages
- 77

"invoice" (this query is linked from access to sql) in which i have to export the results into an excel worksheet, i
have a vba code from the cmd button to perform this but i keep gettting an
error message: runtime error '3251 operation not supported for this type of
object, can someone help ? my access database in in access 2000
Private Sub cmdExcel_Click()
Dim strQryName As String, strXLFile As String, strName As String
strQryName = "Invoice query"
strXLFile = "C:\Documents and Settings\strName\Desktop\Invoice .xls"
strName = GetUserName()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, strQryName, strXLFile
If MsgBox("Do you want to view the file?", vbYesNo) = vbYes Then
FollowHyperlink "C:\Documents and Settings\strName\Desktop\Invoice.xls"
End If
End Sub