Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel Pivot Table Wizard
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00836785
Message ID:
00836898
Views:
16
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?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform