R
rsbutterfly219 via AccessMonster.com
hi guys, i need your help, i have a form call "test" wiht a query called
"invoice" 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 pleaseL!!!! my access database in in access 2000
Private Sub cmdExcel_Click()
Dim xlExc As Object, xlWB As Object
Dim strQryName As String, strXLFile As String
strQryName = "Invoice"
strXLFile = "C:\Documents and Settings\test.xls"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, strQryName,
strXLFile
Set xlExc = CreateObject("Excel.Application")
xlExc.Visible = True
Set xlWB = xlExc.Workbooks.Open(strXLFile)
Set xlWB = Nothing
Set xlExc = Nothing
End Sub
** the debug tool points at the line starting wiht docmd.transferspreadsheet..
...
any help would be really apreciate it!!!
"invoice" 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 pleaseL!!!! my access database in in access 2000
Private Sub cmdExcel_Click()
Dim xlExc As Object, xlWB As Object
Dim strQryName As String, strXLFile As String
strQryName = "Invoice"
strXLFile = "C:\Documents and Settings\test.xls"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, strQryName,
strXLFile
Set xlExc = CreateObject("Excel.Application")
xlExc.Visible = True
Set xlWB = xlExc.Workbooks.Open(strXLFile)
Set xlWB = Nothing
Set xlExc = Nothing
End Sub
** the debug tool points at the line starting wiht docmd.transferspreadsheet..
...
any help would be really apreciate it!!!