[python-win32] Creating pivot tables in excel using python

Tim Roberts timr at probo.com
Fri Nov 18 20:32:11 CET 2005


On Thu, 17 Nov 2005 13:36:27 +0100,  Peter Sch?tz 
<peter.schuetz at gmail.com> wrote:

>I am using Python 2.4.1 and I want to retrieve data from an Access database
>and display the results in an Excel pivot table. To get the data out of
>Access is no problem, but I have problems creating the pivot table in Excel.what I came up with
>
...

>Traceback (most recent call last):
>File "<stdin>", line 1, in ?
>File "C:\Python24\lib\site-packages\win32com\client\__init__.py", line 463,
>in __setattr__
>self._oleobj_.Invoke(*(args + (value,) + defArgs))
>pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, None, None,
>None, 0, -2146827284), None)
>
>As you can see, I get the PivotCache object, but I need to set the Recordset
>in order to use rs. I get the same error message when want to set
>pc.OptimizeCache to True. Honestly, I have no idea what is going on, so if
>someone could help me?
>


Well, -2146827284 is 800A03EC, which is some kind of generic "access 
denied" error within Excel.

Can you run this EXACT sequence in VBA within Excel?

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-win32 mailing list