"Expected function or variable" while using transferdatasheet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi all,

I am trying to do thisin the MSaccess form coding
I added a button to run Excel application and the code for the button looks
like this
Private Sub Command93_Click()
On Error GoTo Err_Command93_Click
DoCmd.TransferSpreadsheet(acExport, acSpreadsheetTypeExcel9,
qKPWC_RECOUP, "C:\TRY", YES)

Exit_Command93_Click:
Exit Sub

Err_Command93_Click:
MsgBox Err.Description
Resume Exit_Command93_Click

End Sub

but the code dosent run and is giving me an error

1) It gives me a error that "=" is expected somewhere. Does the
transferdatasheet action return any value. If it does what datatype does it
return

I tried modifying and added a
Dim x as variant
and assigned
x = DoCmd.TransferSpreadsheet(acExport, acSpreadsheetTypeExcel9,
qKPWC_RECOUP, "C:\TRY", YES)

but now while executing the code it gives me

Compile error : highlighted on Transferspreadsheet method
"Expected function or variable"

Please help

Madhuri
 
see reply in the thread that we're already in..... please don't start a new
thread unless you have a new question.
 
Back
Top