Group:  Microsoft Access » microsoft.public.access.adp.sqlserver
Thread: Problems Exporting SP to excel via docmd.outputto

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Problems Exporting SP to excel via docmd.outputto
"Diego" <diego.lotti[ at ]nospamiol.it> 30.11.2005 08:50:13
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


Re: Problems Exporting SP to excel via docmd.outputto
"giorgio rancati" <giorgio_No_Spalmer_rancati[ at ]tiscali.it> 01.12.2005 17:02:00
Hi Diego,

You can't use SP with parameters.
You can create a temporary view with Sql statment and send it to Excel
spreadshet.
View this thred
----
http://www.google.it/groups?threadm=eL4EA8%23WFHA.1404[ at ]TK2MSFTNGP09.phx.gbl
----

p.s.
mi sembra di capire che parli Italiano, se vuoi posso spiegarti meglio nel
newsgroup microsoft.public.it.office.access
L'Inglese non è il mio forte :-)

Ciao
--
Giorgio Rancati
[Office Access MVP]

"Diego" <diego.lotti[ at ]nospamiol.it> ha scritto nel messaggio
news:eGhRWsY9FHA.220[ at ]TK2MSFTNGP14.phx.gbl...
[Quoted Text]
> 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
>
>


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net