Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel Pivot Table Wizard
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00836785
Message ID:
00836912
Vues:
14
Thanks.

Also I used to follow the VBA Help, where for dialog.show they wrote:
"To find the arguments to set, locate the corresponding dialog box constant in Built-In Dialog Box Argument Lists. "

So for xlDialogPivotTableWizard there are only 10 arguments (I am in Excdel97 at this moment). I see that you are using 16 arguments, and it works. So, how/where do you find the proper syntax?



>Got that from MSDN... but I can't find the link anymore :\
>
>anyway, it stated that if you use the external data, you NEED to give the SELECT statement[2nd argument], which in my case is left blank to let the user make his selection, and the ODBC Connection String [Last Argument].
>
>With that properly formated, it works exactly as I wanted it.
>
>
>
>>Good to know. How did you find the mandatory arguments? (I suspect it is why I was not able to use Show with arguments previously.)
>>
>>
>>>I finally got it to work...
>>>
>>>There it is :
>>>
>>>
>>>#DEFINE xlDialogPivotTableWizard 312
>>>#DEFINE xlExternal  2
>>>
>>>DIME gaSelect[1]
>>>gaSelect[1] = ""
>>>lcODBCConnexion = "ODBC;DRIVER=SQL Server;SERVER= YourSQLServerName;UID=YourLogin;PWD=YourPassword;APP=Microsoft Visual FoxPro;DATABASE=DBName"
>>>
>>>oXL = CREATEOBJECT("Excel.Application")
>>>oWB = oXL.Workbooks.add()
>>>oSheet = oWB.ActiveSheet
>>>oXL.visible = .T.
>>>oDialog = oxl.Dialogs(xlDialogPivotTableWizard)
>>>
>>>oDialog.Show(xlExternal, @gaSelect,,,,,,,,,,,,, .T., lcODBCConnexion)
>>>
>>>
>>>
>>>for External DataSource, the 1st, 2nd, and last parameters are mandatory.
>>>
>>>Have a nice day,
>>>
>>>Yanick
>>>>FYI,
>>>>
>>>>Show does accept params... at least for some dialogs!
>>>>
>>>>
>>>>#DEFINE xlDialogSaveAs  5
>>>>oxl.Dialogs(xlDialogSaveAs).Show("FileName2Save")
>>>>
>>>>
>>>>>AFAIK, show method does not accept parameters.
>>>>>
>>>>>>Yuri,
>>>>>>
>>>>>>I'am already doing that, put for flexibility purposes I want to give my user the ability to Create/Define new Pivot that gets saved and that they can call afterwards with a simple click. I need both ways...
>>>>>>
>>>>>>Thanks anyway for your help.
>>>>>>
>>>>>>Still I need to pass params to the Show Method.
>>>>>>
>>>>>>
>>>>>>>Then you can create a pivot table with predefined properties, activate it and call the dialog from there. The very same way as it is allowed to do in Excel itself.
>>>>>>>
>>>>>>>>Actually I need to have the Dialog to let user interact with it...
>>>>>>>>
>>>>>>>>Anyone else?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform