"Expected function or variable" while using transferdatasheet

M

Madhuri

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
 
K

Ken Snell [MVP]

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

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