Erreur d'execution '6' Dépassement de capacité
Résolu
scuti
Messages postés
31
Date d'inscription
Statut
Membre
Dernière intervention
-
scuti Messages postés 31 Date d'inscription Statut Membre Dernière intervention -
scuti Messages postés 31 Date d'inscription Statut Membre Dernière intervention -
Bonjour, Je débute en VBA, voici mon code.
Mon problème est comme intitulé dans le titre que lorsque je lance mon programme le message d'erreur erreur d'execution 6 dépassement de capacité.
Mon tableau à comme dimension 40 colonnes / 365 000 lignes.
La ligne qui pose problème est :
LI = O.Cells(Application.Rows.Count, "A").End(xlUp).Row
comment contourné la limite de capacité ?
Merci d'avance pour votre aide.
Mon problème est comme intitulé dans le titre que lorsque je lance mon programme le message d'erreur erreur d'execution 6 dépassement de capacité.
Mon tableau à comme dimension 40 colonnes / 365 000 lignes.
Sub Graphique_Compactage()
'
' Graphique_Compactage Macro
' Crée un graphique confrontant les forces de compactage demandée et apliquée en fonction du temps
'
' Touche de raccourci du clavier: Ctrl+Shift+C
'
Dim O As Worksheet
Dim R As Range
Dim COL As Integer
Dim LI As Integer
Set O = Worksheets("ProductionParameters")
Set R = O.Rows(1).Find("Force de compactage (Mesure) - 82", , xlValues, xlWhole)
If R Is Nothing Then Exit Sub
COL = R.Column
LI = O.Cells(Application.Rows.Count, "A").End(xlUp).Row
Set pl = Application.Union(O.Range(O.Cells(1, 1), O.Cells(LI, 1)), O.Range(O.Cells(1, COL), O.Cells(LI, COL)))
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlXYScatterSmoothNoMarkers
ActiveChart.SetSourceData Source:=pl
O.Cells(1, COL).Select
ActiveChart.Location Where:=xlLocationAsNewSheet, Name:= _
"Graphique Compactage"
ActiveChart.ClearToMatchStyle
ActiveChart.ChartStyle = 241
ActiveChart.SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
ActiveChart.SetElement (msoElementPrimaryValueAxisTitleAdjacentToAxis)
ActiveChart.Axes(xlValue).HasTitle = True
ActiveChart.Axes(xlCategory).AxisTitle.Select
Selection.Caption = "Temps en HH:MM:SS"
ActiveChart.Axes(xlValue).AxisTitle.Select
Selection.Caption = "Force en Newton"
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Select
ActiveChart.PlotArea.Select
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Select
ActiveChart.Axes(xlValue).Select
ActiveChart.ChartArea.Select
ActiveChart.Axes(xlCategory).Select
Selection.TickLabels.NumberFormat = "h:mm;@"
ActiveChart.ChartArea.Select
ActiveChart.ChartTitle.Select
Selection.Caption = "Forces de compactage demandée et apliquée en fonction du temps"
ActiveChart.ChartArea.Select
ActiveChart.Axes(xlCategory).Select
Selection.TickLabels.NumberFormat = "[$-x-systime]h:mm:ss AM/PM"
ActiveChart.ChartArea.Select
ActiveChart.SetElement (msoElementLegendTop)
End Sub
La ligne qui pose problème est :
LI = O.Cells(Application.Rows.Count, "A").End(xlUp).Row
comment contourné la limite de capacité ?
Merci d'avance pour votre aide.
A voir également:
- Erreur d'execution 6 dépassement de capacité
- Belote a 6 ✓ - Forum Loisirs / Divertissements
- Le logiciel amd a détecté un dépassement de délai du pilote ✓ - Forum Carte graphique
- Règle du jeu - Forum jeux en ligne
- Erreur 3005 france tv - Forum TV & Vidéo
- Nero 6 - Télécharger - Gravure
1 réponse
bonjour
tu as déclaré LI as integer pour identifier la dernière ligne utilisée
le typte integer va de -32 768 et 32 767 ( 2 octets)...
il faut donc que tu déclares LI as long : -2 147 483 648 et 2 147 483 647 (4 octets)
Au passage :
40colonnes---> à déclarer " as byte" (va de 0 a 255--> 1 octet) au lieu d'integer.
Edit:
Topos sur les variables
https://silkyroad.developpez.com/VBA/LesVariables/
https://mhubiche.developpez.com/Access/variables/
Michel
tu as déclaré LI as integer pour identifier la dernière ligne utilisée
le typte integer va de -32 768 et 32 767 ( 2 octets)...
il faut donc que tu déclares LI as long : -2 147 483 648 et 2 147 483 647 (4 octets)
Au passage :
40colonnes---> à déclarer " as byte" (va de 0 a 255--> 1 octet) au lieu d'integer.
Edit:
Topos sur les variables
https://silkyroad.developpez.com/VBA/LesVariables/
https://mhubiche.developpez.com/Access/variables/
Michel
scuti
Messages postés
31
Date d'inscription
Statut
Membre
Dernière intervention
Merci pour ta réponse michel