Problems Exporting SP to excel via docmd.outputto

D

Diego

Hi,

i experience this problem:

I have an SP called Test which expect a date range, so the string to call
the sp is: stSP="EXEC Test '01/01/05','31/12/05'", for example.

I want to export the resultset to excel using:

DoCmd.OutputTo acOutputStoredProcedure , stSP, acFormatXLS, "c:\prova.xls",
1

everyting works, but excel tries to use the name of the SP (stSP) as the
name of the worksheet. But a string with the char (') is not a correct name
ad so when I open the report i get errors on the file name.


Is there a way to solve this? Why can't I specify the name for the sheet? If
I can't use SP with parameters, where is the point of giving this feature?

Thank you very much
 

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