I need to update a pivot table that resides on a Microsoft Excel worksheet.
I created a stored procedure (dbo.USP_DMO_EXCEL_Pivot_R
) that uses OLE Automation (sp_OA*) to refresh, every night (without open the Excel file), the pivot table data in Microsoft Excel worksheet.
The stored procedure works well in this enviroment:
- OS Windows Server 2003
- Office 2003
- SQL Server 2008
But it does not work with:
- OS Windows Server 2008 64-bit or Windows 7 64-bit
- Office 2007
- SQL Server 2008 64-bit
The Excel file will open correctly, bit I get an error during execution method RefreshTable in the following line of code:
exec sp_OAMethod @objWorkSheet PivotTables('Pivot_Name').
The execution of stored procedures to stop crashes and I have to forcefully close Excel task "Excel *32" on server in which I performed.
When forced to close the task, I get the following error:
-2146827284 Unable to find Microsoft Office Excel PivotTables property for the class Worksheet. C:\Program Files (x86)\Microsoft Office\Office12\1040\0 XLMAIN11.CHM
Message 50000, Level 16, State 1, Server <name> USP_DMO_Excel_Pivot_Refres
hTable procedure, line 369
Whilst Error: Return object workbooks, Could not find property PivotTables for Class Worksheet
I also installed the 2007 Office System Driver: Data Connectivity Components (http://www.microsoft.com/downloads/details.aspx?familyid=7554f536-8c28-4598-9b72-ef94e038c891&displaylang=en
) but without improvement.
Thanks a lot!