Help Please ! Erreur d'éxécution 5 dans une Macro sur Excel 2007

Ikoo

XLDnaute Nouveau
Bonjour à Tous,

Je deviens chèvre. Bien qu'ayant un niveau de débutant confirmé (...:p...) j'ai déjà réalisé qques macros du même type que celle développée ci-dessous.

Aujourd'hui je me trouve confronté à une erreur absolument insoluble à mon niveau :mad:. J'ai eu beau chercher dans un max de forum :confused:, les solutions proposées ne changent rien pour moi (essentiellement remplacer le terme "Create" par "Add").

Le but ? "Simplement" créer un TCD synthétisant mon onglet BASE TCD...

Une Âme Charitable se pencherait-elle sur mon épineux problème (qui est certainement lié à une pécadille pour l'un(e) d'entre vous).

Je vous remercie tous par avance pour l'attention que vous porterez à cette bouteille lancée dans l'océan Macrotique. :)

Guillaume.

(je tente de joindre mes fichiers... mais je n'arrive pas à les compresser dans la taille demandée)

Voici mon code et la difficulté:

Sub STATS_FO_DEPLOYES_PAR_GESTIONNAIRES_JOURNALIER()
'
' STATS_FO_DEPLOYES_PAR_GESTIONNAIRES_JOURNALIER Macro
'
' Touche de raccourci du clavier: Ctrl+g
'
Workbooks.Add
ChDir _
"P:\Statistiques\GUILLAUME\FRONT OFFICE\STATS FO-journalier\GESTIONNAIRES"
ActiveWorkbook.SaveAs Filename:= _
"P:\Statistiques\GUILLAUME\FRONT OFFICE\STATS FO-journalier\GESTIONNAIRES\DEPLOYES PAR GESTIONNAIRES JOURNALIER.xlsx" _
, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
Workbooks.Open Filename:= _
"C:\Documents and Settings\lassusg\Desktop\TRAVAIL\OUTILS AUDIT - QUALITE\Base Statistique GL.xlsx"
Windows("DEPLOYES PAR GESTIONNAIRES JOURNALIER.xlsx").Activate
Sheets("Feuil1").Select
Sheets("Feuil1").Name = "REQ APPELS"
Sheets("Feuil2").Select
Sheets("Feuil2").Name = "BASE TCD"
Sheets("Feuil3").Select
Sheets("Feuil3").Name = "DEPLOYES PAR GESTIONNAIRES"
Sheets("DEPLOYES PAR GESTIONNAIRES").Select
With ActiveWorkbook.Sheets("DEPLOYES PAR GESTIONNAIRES").Tab
.Color = 255
.TintAndShade = 0
End With
Sheets("REQ APPELS").Select
Application.Goto Reference:="R1C1"
With ActiveSheet.ListObjects.Add(SourceType:=0, Source:=Array(Array( _
"ODBC;DSN=Excel Files;DBQ=P:\Statistiques\GUILLAUME\FRONT OFFICE\STATS FO-journalier\GESTIONNAIRES\ClaimProgressionListing (brut Gest" _
), Array( _
"ionnaires).XLSX;DefaultDir=P:\Statistiques\GUILLAUME\FRONT OFFICE\STATS FO-journalier\GESTIONNAIRES;DriverId=1046;MaxBufferSize" _
), Array("=2048;PageTimeout=5;")), Destination:=Range("$A$1")).QueryTable
.CommandText = Array( _
"SELECT `CLIENT_$`.`Date et heure d’appel 1`, `CLIENT_$`.`Appel 1 statué par` FROM `CLIENT_$` `CLIENT_$` WHERE (`C" _
, "LIENT_$`.`Appel 1 statué par`<>'(null)')")
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.SourceConnectionFile = _
"C:\Documents and Settings\lassusg\Application Data\Microsoft\Queries\FRONT OFFICE\Déployés par Gestionnaires\FO-ClaimProgressionListing (APPEL1).dqy"
.ListObject.DisplayName = "Tableau_FO_ClaimProgressionListing__APPEL1"
.Refresh BackgroundQuery:=False
End With
Range("Tableau_FO_ClaimProgressionListing__APPEL1[Appel 1 statué par]").Select
Selection.ListObject.ListColumns.Add Position:=2
Range( _
"Tableau_FO_ClaimProgressionListing__APPEL1[[#Headers],[Date et heure d’appel 2]]" _
).Select
ActiveCell.FormulaR1C1 = "DATES"
Range("B2").Select
ActiveCell.FormulaR1C1 = "=TRUNC([Date et heure d’appel 1]*1)"
Range( _
"Tableau_FO_ClaimProgressionListing__APPEL1[[#Headers],[Appel 1 statué par]]"). _
Select
ActiveCell.FormulaR1C1 = "PAR"
Range("D1").Select
ActiveCell.FormulaR1C1 = "TYPE"
Range("D2").Select
ActiveCell.FormulaR1C1 = "Appel 1"
Range("D2").Select
Selection.AutoFill Destination:=Range( _
"Tableau_FO_ClaimProgressionListing__APPEL1[TYPE]"), Type:=xlFillCopy
Range("Tableau_FO_ClaimProgressionListing__APPEL1[TYPE]").Select
Application.Goto Reference:="R40000C1"
With ActiveSheet.ListObjects.Add(SourceType:=0, Source:=Array(Array( _
"ODBC;DSN=Excel Files;DBQ=P:\Statistiques\GUILLAUME\FRONT OFFICE\STATS FO-journalier\GESTIONNAIRES\ClaimProgressionListing (brut Gest" _
), Array( _
"ionnaires).XLSX;DefaultDir=P:\Statistiques\GUILLAUME\FRONT OFFICE\STATS FO-journalier\GESTIONNAIRES;DriverId=1046;MaxBufferSize" _
), Array("=2048;PageTimeout=5;")), Destination:=Range("$A$40000")).QueryTable
.CommandText = Array( _
"SELECT `CLIENT_$`.`Date et heure d’appel 2`, `CLIENT_$`.`Appel 2 statué par` FROM `CLIENT_$` `CLIENT_$` WHERE (`C" _
, "LIENT_$`.`Appel 2 statué par`<>'(null)')")
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.SourceConnectionFile = _
"C:\Documents and Settings\lassusg\Application Data\Microsoft\Queries\FRONT OFFICE\Déployés par Gestionnaires\FO-ClaimProgressionListing (APPEL2).dqy"
.ListObject.DisplayName = "Tableau_FO_ClaimProgressionListing__APPEL2"
.Refresh BackgroundQuery:=False
End With
Range("Tableau_FO_ClaimProgressionListing__APPEL2[Appel 2 statué par]").Select
Selection.ListObject.ListColumns.Add Position:=2
Range( _
"Tableau_FO_ClaimProgressionListing__APPEL2[[#Headers],[Date et heure d’appel 3]]" _
).Select
ActiveCell.FormulaR1C1 = "DATES"
Range("B40001").Select
ActiveCell.FormulaR1C1 = "=TRUNC([Date et heure d’appel 2]*1)"
Range( _
"Tableau_FO_ClaimProgressionListing__APPEL2[[#Headers],[Appel 2 statué par]]"). _
Select
ActiveCell.FormulaR1C1 = "PAR"
Range("D40000").Select
ActiveCell.FormulaR1C1 = "TYPE"
Range("D40001").Select
ActiveCell.FormulaR1C1 = "Appel 2"
Range("D40001").Select
Selection.AutoFill Destination:=Range( _
"Tableau_FO_ClaimProgressionListing__APPEL2[TYPE]"), Type:=xlFillCopy
Range("Tableau_FO_ClaimProgressionListing__APPEL2[TYPE]").Select
Application.Goto Reference:="R90000C1"
With ActiveSheet.ListObjects.Add(SourceType:=0, Source:=Array(Array( _
"ODBC;DSN=Excel Files;DBQ=P:\Statistiques\GUILLAUME\FRONT OFFICE\STATS FO-journalier\GESTIONNAIRES\ClaimProgressionListing (brut Gest" _
), Array( _
"ionnaires).XLSX;DefaultDir=P:\Statistiques\GUILLAUME\FRONT OFFICE\STATS FO-journalier\GESTIONNAIRES;DriverId=1046;MaxBufferSize" _
), Array("=2048;PageTimeout=5;")), Destination:=Range("$A$90000")).QueryTable
.CommandText = Array( _
"SELECT `CLIENT_$`.`Date et heure d’appel 3`, `CLIENT_$`.`Appel 3 statué par` FROM `CLIENT_$` `CLIENT_$` WHERE (`C" _
, "LIENT_$`.`Appel 3 statué par`<>'(null)')")
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.SourceConnectionFile = _
"C:\Documents and Settings\lassusg\Application Data\Microsoft\Queries\FRONT OFFICE\Déployés par Gestionnaires\FO-ClaimProgressionListing (APPEL3).dqy"
.ListObject.DisplayName = "Tableau_FO_ClaimProgressionListing__APPEL3"
.Refresh BackgroundQuery:=False
End With
Range("Tableau_FO_ClaimProgressionListing__APPEL3[Appel 3 statué par]").Select
Selection.ListObject.ListColumns.Add Position:=2
Range( _
"Tableau_FO_ClaimProgressionListing__APPEL3[[#Headers],[Date et heure d’appel 4]]" _
).Select
ActiveCell.FormulaR1C1 = "DATES"
Range("B90001").Select
ActiveCell.FormulaR1C1 = "=TRUNC([Date et heure d’appel 3]*1)"
Range( _
"Tableau_FO_ClaimProgressionListing__APPEL3[[#Headers],[Appel 3 statué par]]"). _
Select
ActiveCell.FormulaR1C1 = "PAR"
Range("D90000").Select
ActiveCell.FormulaR1C1 = "TYPE"
Range("D90001").Select
ActiveCell.FormulaR1C1 = "Appel 3"
Range("D90001").Select
Selection.AutoFill Destination:=Range( _
"Tableau_FO_ClaimProgressionListing__APPEL3[TYPE]"), Type:=xlFillCopy
Range("Tableau_FO_ClaimProgressionListing__APPEL3[TYPE]").Select
Application.Goto Reference:="R140000C2"
With ActiveSheet.ListObjects.Add(SourceType:=0, Source:=Array(Array( _
"ODBC;DSN=Excel Files;DBQ=P:\Statistiques\GUILLAUME\FRONT OFFICE\STATS FO-journalier\GLOBAL\DEPLOYES\AllDeployments (brut journalier)" _
), Array( _
".XLSX;DefaultDir=P:\Statistiques\GUILLAUME\FRONT OFFICE\STATS FO-journalier\GLOBAL\DEPLOYES;DriverId=1046;MaxBufferSize=2048;Pa" _
), Array("geTimeout=5;")), Destination:=Range("$B$140000")).QueryTable
.CommandText = Array( _
"SELECT `Déploiements$`.`Date De Déploiement`, `Déploiements$`.`Déployée Par`, `Déploiements$`.`Type De Garage` FRO" _
, _
"M `Déploiements$` `Déploiements$` WHERE (`Déploiements$`.`Type De Garage`<>'TYPE DE GARAGE') ORDER BY `Déploiemen" _
, "ts$`.`Date De Déploiement`")
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.SourceConnectionFile = _
"C:\Documents and Settings\lassusg\Application Data\Microsoft\Queries\FRONT OFFICE\Déployés par Gestionnaires\FO-AllDeployments (net Gestionnaires journalier).dqy"
.ListObject.DisplayName = _
"Tableau_FO_AllDeployments__net_Gestionnaires_journalier"
.Refresh BackgroundQuery:=False
End With
Range( _
"Tableau_FO_AllDeployments__net_Gestionnaires_journalier[[#Headers],[Date De Déploiement]]" _
).Select
ActiveCell.FormulaR1C1 = "DATES"
Range( _
"Tableau_FO_AllDeployments__net_Gestionnaires_journalier[[#Headers],[Déployée Par]]" _
).Select
ActiveCell.FormulaR1C1 = "PAR"
Range( _
"Tableau_FO_AllDeployments__net_Gestionnaires_journalier[[#Headers],[Type De Garage]]" _
).Select
ActiveCell.FormulaR1C1 = "TYPE"
Columns("B:B").Select
Range("B139977").Activate
Selection.NumberFormat = "m/d/yyyy"
Cells.Select
Range("A139977").Activate
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("BASE TCD").Select
Application.CutCopyMode = False
With ActiveSheet.ListObjects.Add(SourceType:=0, Source:=Array(Array( _
"ODBC;DSN=Excel Files;DBQ=P:\Statistiques\GUILLAUME\FRONT OFFICE\STATS FO-journalier\GESTIONNAIRES\DEPLOYES PAR GESTIONNAIRES JOURNAL" _
), Array( _
"IER.xlsx;DefaultDir=P:\Statistiques\GUILLAUME\FRONT OFFICE\STATS FO-journalier\GESTIONNAIRES;DriverId=1046;MaxBufferSize=2048;P" _
), Array("ageTimeout=5;")), Destination:=Range("$A$1")).QueryTable
.CommandText = Array( _
"SELECT `'REQ APPELS$'`.DATES, `'REQ APPELS$'`.PAR, `'REQ APPELS$'`.TYPE" & Chr(13) & "" & Chr(10) & "FROM `'REQ APPELS$'` `'REQ APPELS$'`" & Chr(13) & "" & Chr(10) & "WHERE (`'REQ APPELS$'`.DATES Is Not Null) AND (`'REQ APPELS$'`.PAR Is Not Null) AND (`'RE" _
, "Q APPELS$'`.TYPE Is Not Null)" & Chr(13) & "" & Chr(10) & "ORDER BY `'REQ APPELS$'`.DATES DESC")
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.ListObject.DisplayName = "Tableau_REQ_APPELS_vers_BASE_TCD"
.Refresh BackgroundQuery:=False
End With
Columns("A:A").Select
Selection.NumberFormat = "m/d/yyyy"
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Application.Goto Reference:="R1C1"
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Tableau_REQ_APPELS_vers_BASE_TCD", Version:=xlPivotTableVersion12) _
.CreatePivotTable TableDestination:="DEPLOYES PAR GESTIONNAIRES!R1C2", _
TableName:="Tableau croisé dynamique1", DefaultVersion:= _
xlPivotTableVersion12
Sheets("DEPLOYES PAR GESTIONNAIRES").Select
Cells(1, 2).Select
ActiveSheet.PivotTables("Tableau croisé dynamique1").RowAxisLayout xlOutlineRow
ActiveSheet.PivotTables("Tableau croisé dynamique1").ShowTableStyleRowStripes _
= True
ActiveSheet.PivotTables("Tableau croisé dynamique1"). _
ShowTableStyleColumnStripes = True
ActiveSheet.PivotTables("Tableau croisé dynamique1").TableStyle2 = _
"PivotStyleDark3"
With ActiveSheet.PivotTables("Tableau croisé dynamique1").PivotFields("DATES")
.Orientation = xlRowField
.Position = 1
End With
ActiveSheet.PivotTables("Tableau croisé dynamique1").PivotFields("DATES"). _
AutoSort xlDescending, "DATES"
With ActiveSheet.PivotTables("Tableau croisé dynamique1").PivotFields("PAR")
.Orientation = xlRowField
.Position = 2
End With
With ActiveSheet.PivotTables("Tableau croisé dynamique1").PivotFields("PAR")
End With
With ActiveSheet.PivotTables("Tableau croisé dynamique1").PivotFields("TYPE")
.Orientation = xlColumnField
.Position = 1
End With
ActiveSheet.PivotTables("Tableau croisé dynamique1").AddDataField ActiveSheet. _
PivotTables("Tableau croisé dynamique1").PivotFields("TYPE"), "Nombre de TYPE" _
, xlCount
Cells.Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
ActiveSheet.PivotTables("Tableau croisé dynamique1").PivotSelect _
"'Appel 1':'Appel 3'", xlDataAndLabel, True
Selection.Group
ActiveSheet.PivotTables("Tableau croisé dynamique1").PivotSelect _
"'Appel 1':'Appel 3'", xlDataAndLabel, True
ActiveWindow.SmallScroll ToRight:=5
ActiveSheet.PivotTables("Tableau croisé dynamique1").PivotSelect _
"TYPE['Approuvé Réseau','Non Approuvé Réseau']", xlDataAndLabel, True
Selection.Group
ActiveSheet.PivotTables("Tableau croisé dynamique1").PivotSelect "TYPE[GA:GSA]" _
, xlDataAndLabel, True
Selection.Group
ActiveSheet.PivotTables("Tableau croisé dynamique1").PivotSelect "GA:GSA", _
xlDataAndLabel, True
Range("I2").Select
ActiveSheet.PivotTables("Tableau croisé dynamique1").PivotFields("TYPE2"). _
PivotItems("Groupe3").ShowDetail = False
Range("G2").Select
ActiveSheet.PivotTables("Tableau croisé dynamique1").PivotFields("TYPE2"). _
PivotItems("Groupe2").ShowDetail = False
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Range("D2").Select
ActiveSheet.PivotTables("Tableau croisé dynamique1").PivotFields("TYPE2"). _
PivotItems("Groupe1").ShowDetail = False
ActiveSheet.PivotTables("Tableau croisé dynamique1").PivotFields("TYPE2"). _
PivotItems("Groupe1").Caption = "APPELS"
Range("E2").Select
ActiveSheet.PivotTables("Tableau croisé dynamique1").PivotFields("TYPE2"). _
PivotItems("Groupe2").Caption = "SAD"
Range("F2").Select
ActiveSheet.PivotTables("Tableau croisé dynamique1").PivotFields("TYPE2"). _
PivotItems("Groupe3").Caption = "HORS SAD"
Range("G2").Select
ActiveSheet.PivotTables("Tableau croisé dynamique1").RowGrand = False
Range("B3").Select
Selection.Copy
Range("A1:A3").Select
Range("A3").Activate
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Range("A1:A3").Select
ActiveCell.FormulaR1C1 = "Taux de Transformation"
With ActiveCell.Characters(Start:=1, Length:=22).Font
.Name = "Calibri"
.FontStyle = "Gras"
.Size = 11
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
.ThemeFont = xlThemeFontMinor
End With
Range("A4").Select
Columns("A:A").ColumnWidth = 13.57
Columns("A:A").Select
Selection.NumberFormat = "0.00%"
Range("A4").Select
ActiveCell.FormulaR1C1 = "=RC[4]/RC[3]"
Range("A4").Select
Selection.AutoFill Destination:=Range("A4:A100"), Type:=xlFillDefault
Range("A4:A100").Select
Selection.FormatConditions.AddIconSetCondition
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1)
.ReverseOrder = False
.ShowIconOnly = False
.IconSet = ActiveWorkbook.IconSets(xl3TrafficLights2)
End With
With Selection.FormatConditions(1).IconCriteria(2)
.Type = xlConditionValueNumber
.Value = 0.5
.Operator = 7
End With
With Selection.FormatConditions(1).IconCriteria(3)
.Type = xlConditionValueNumber
.Value = 0.8
.Operator = 7
End With
ActiveWindow.ScrollRow = 100
ActiveWindow.ScrollRow = 94
ActiveWindow.ScrollRow = 89
ActiveWindow.ScrollRow = 74
ActiveWindow.ScrollRow = 53
ActiveWindow.ScrollRow = 43
ActiveWindow.ScrollRow = 32
ActiveWindow.ScrollRow = 22
ActiveWindow.ScrollRow = 17
ActiveWindow.ScrollRow = 6
ActiveWindow.ScrollRow = 1
Range("B1").Select
ActiveSheet.PivotTables("Tableau croisé dynamique1").DisplayFieldCaptions = _
False
Range("A1:A3").Select
Selection.AutoFilter
Windows("Base Statistique GL.xlsx").Activate
ActiveWindow.Close
ActiveWorkbook.Save
End Sub
 
Dernière édition:

Dranreb

XLDnaute Barbatruc
Re : Help Please ! Erreur d'éxécution 5 dans une Macro sur Excel 2007

Bonjour.
Je ne pense pas que cela ait beaucoup changé par rapport à Excel 2003.
Dans l'aide:
1) - Je ne trouve pas de méthode Create pour la collection PivotCaches. C'est Add qui convient, et renvoit bien un objet PivotCache.
2) - Le paramètre TableDestination de la methode CreatePivotTable doit être de type Range et non String.
Cordialement.
 

Ikoo

XLDnaute Nouveau
Re : Help Please ! Erreur d'éxécution 5 dans une Macro sur Excel 2007

Bonjour.
Je ne pense pas que cela ait beaucoup changé par rapport à Excel 2003.
Dans l'aide:
1) - Je ne trouve pas de méthode Create pour la collection PivotCaches. C'est Add qui convient, et renvoit bien un objet PivotCache.
2) - Le paramètre TableDestination de la methode CreatePivotTable doit être de type Range et non String.
Cordialement.

Merci pour ton retour Dranreb.

Je ne dois pas savoir m'y prendre car j'ai testé cette méthode et cela ne change rien; la même erreur subsiste.

Ce qui me rends dingue c'est que j'ai d'autres macros qui utilisent le même code (mises à part les sources) et ça fonctionne nickel.

Par exemple ce code n'a aucun pb:

Application.Goto Reference:="R1C1"
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Tableau_FO_AllDeployments__net_journalier", Version:=xlPivotTableVersion12). _
CreatePivotTable TableDestination:="DEPLOYES!R1C1", TableName:= _
"Tableau croisé dynamique2", DefaultVersion:=xlPivotTableVersion12
Sheets("DEPLOYES").Select
Cells(1, 1).Select[/B
]

C'est, sauf erreur, la même syntaxe que j'utilise pour les 2, non?

Merci d'avance.
 

Dranreb

XLDnaute Barbatruc
Re : Help Please ! Erreur d'éxécution 5 dans une Macro sur Excel 2007

S'il n'a pas de problème je serait presque fondé à supposer que c'est parce qu'il n'est jamais exécuté, ou qu'il provoque une erreur non détectée à cause d'un On Error Resume Next, et qu'on continue à se servir sans le savoir de ce qui préexistait...
C'est en tout cas ce que me donnent à penser les infos de l'aide Excel 2003 dont je dispose.
 

Ikoo

XLDnaute Nouveau
Re : Help Please ! Erreur d'éxécution 5 dans une Macro sur Excel 2007

Re,

Trouvé !!! Ennnnnfin ! C'était bête comme choux (normal pour un pb qui me rendait chèvre...) : il fallait "simplement" créer mon TCD dans une Nouvelle Feuille puis renommer la-dite nouvelle feuille...

Merci pour la participation de Dranreb (ça m'a appris à me servir de l'aide excel en + du reste...)

A+
 

Discussions similaires