Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing arrays to Excel variant properties
Message
From
01/04/2004 08:06:21
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
01/04/2004 07:34:53
Norbert Kustra
SunSoft plus spol. s r.o.
Dolny Kubin, Slovakia
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00887487
Message ID:
00891440
Views:
35
>If your e-mail doesn't work, you can try this:
>Download the sample data from http://www.sunsoft.sk/ftp/test.zip
>Open TEST1.XLS - there are two pivottables on the sheet connected to the same pivotcache. Open VFP and try this code:
>xl=GETOBJECT(,"Excel.Application")
>pc=xl.ActiveWorkbook.PivotCaches(1)
>pc.CommandText = 'select * from DS1 ds1'
>... and I get error OLE error code 0x800a03ec: Unknown COM status code... :-(
>When I open TEST2 with one pivottable, all works fine.
>
>Do you have any idea how to reslove this problem?
>Thanks
> Norbert

Norbert,
I downloaded your data and executed below code successfully. It refreshed the data for both pivots :
ox= CreateObject('excel.application')
ox.visible= .t.
ox.Workbooks.Open("D:\cetin\ddrive\UT\norbert\test1.xls")
? 'Waiting....'
Wait window '' timeout 5
? 'Refreshing'
With ox.activeworkbook.pivotcaches(1)
  .Connection = 'OLEDB;Provider=VFPOLEDB.1;'+;
                'Data Source=D:\cetin\ddrive\UT\norbert\'
  .CommandType = 2
  .CommandText = 'select * from DS1 ds1'
  .Refresh
endwith
PS: I've verified it's refreshing from ds1 modifying some values.
Suggestion : Never use GetObject() but CreateObject().
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform