Excel Tablas Pivot importando datos desde dbf
Posted: Tue Jun 24, 2008 9:13 am
Alguien hizo algo?
en lo especifico, tengo problemas para transformar este codigo en VB
Saludos.
en lo especifico, tengo problemas para transformar este codigo en VB
- Code: Select all Expand view
With ActiveWorkbook.PivotCaches.Add(SourceType:=xlExternal)
.Connection = Array( _
"OLEDB;Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=C:\lavwin\wp32\tmp\;Mode=Share Deny Write;Extended Proper" _
, _
"ties="""";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine Type=18;Jet OLED" _
, _
"B:Database Locking Mode=0;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Passwo" _
, _
"rd="""";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet O" _
, "LEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False")
.CommandType = xlCmdTable
.CommandText = Array("vendiTE")
.MaintainConnection = True
.CreatePivotTable TableDestination:="[Cartel3]Foglio1!R3C1", TableName _
:="Tabella_pivot2", DefaultVersion:=xlPivotTableVersion10
End With
With ActiveSheet.PivotTables("Tabella_pivot2").PivotFields("MOV_DAT")
.Orientation = xlRowField
.Position = 1
End With
ActiveSheet.PivotTables("Tabella_pivot2").CalculatedFields.Add "TotaleVendite" _
, "=MOV_PRZ*MOV_QTA", True
ActiveSheet.PivotTables("Tabella_pivot2").PivotFields("TotaleVendite"). _
Orientation = xlDataField
With ActiveSheet.PivotTables("Tabella_pivot2").PivotFields("MOV_DTMAG")
.Orientation = xlColumnField
.Position = 1
End With
Saludos.