IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Excel Discussion :

Problème de tableau excel 2010


Sujet :

Excel

  1. #1
    Nouveau membre du Club
    Homme Profil pro
    Inscrit en
    Janvier 2013
    Messages
    42
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Secteur : Industrie

    Informations forums :
    Inscription : Janvier 2013
    Messages : 42
    Points : 34
    Points
    34
    Par défaut Problème de tableau excel 2010
    bonjour a tous

    J'ai un très gros problème avec excel lorsque j'active une macro
    tout fonctionne bien jusqu’à ce que une fois l'exécution fini le tableau
    devient noir et Windows m'informe que je n'ai plus assez de mémoire

    y a t' il un moyen pour libéré la mémoire une fois que la macro est terminé
    merci pour vos reponse et bonne journée

    mon systeme si il y a lieu a titre information

    processeur: pentium dual-cor 32bits
    mémoire: 4G

  2. #2
    Expert éminent sénior
    Avatar de Marc-L
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Avril 2013
    Messages
    9 468
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2013
    Messages : 9 468
    Points : 18 674
    Points
    18 674
    Par défaut

    Bonjour,

    les problèmes de mémoire peuvent provenir aussi d'un mauvais code …


    Sinon pour libérer la mémoire en fin de procédure, insérer cette instruction : End … (voir l'aide VBA intégrée)

    Pour rappel, ici c'est plutôt le forum des formules de feuille de calculs, il y a un forum dédié au VBA !

  3. #3
    Expert éminent sénior Avatar de Menhir
    Homme Profil pro
    Ingénieur
    Inscrit en
    Juin 2007
    Messages
    16 037
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Finistère (Bretagne)

    Informations professionnelles :
    Activité : Ingénieur
    Secteur : Industrie

    Informations forums :
    Inscription : Juin 2007
    Messages : 16 037
    Points : 32 866
    Points
    32 866
    Par défaut
    Avant de saturer 4Go de mémoire physique avec Excel, il faut vraiment une application extrêmement lourde (du type plusieurs milliards de variables).

    Ca peut soit venir d'un problème dans ton code (sans plus d'info, difficile de t'aider à ce sujet).
    Ou bien d'une autre appli qui tourne en même temps et qui te sature la mémoire (à suive avec l'onglet Performance du gestionnaire de taches).
    Ou simplement d'une barrette mémoire cramée (ou quelque chose du genre).

  4. #4
    Nouveau membre du Club
    Homme Profil pro
    Inscrit en
    Janvier 2013
    Messages
    42
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Secteur : Industrie

    Informations forums :
    Inscription : Janvier 2013
    Messages : 42
    Points : 34
    Points
    34
    Par défaut
    en fait cela doit être du a une macro que je voulais simplifier
    et j'ai fait une discussion a ce propos sur le forum "encore pour les doublons"
    et je n'ai plus eu de réponse
    je voulais tout simplement a faire une boucle du style

    for i=18 to 33

    next i
    mais je n'y ai pas arrivé

    voici le code

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    Sub Doublon()
    Dim Plage As Range, C As Range
     
    Set Plage = Range("B18:H18") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    Set Plage = Range("B19:H19") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    Set Plage = Range("B20:H20") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    Set Plage = Range("B21:H21") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    Set Plage = Range("B22:H22") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    Set Plage = Range("B23:H23") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    Set Plage = Range("B24:H24") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    Set Plage = Range("B25:H25") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    Set Plage = Range("B26:H26") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    Set Plage = Range("B27:H27") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    Set Plage = Range("B28:H28") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    Set Plage = Range("B29:H29") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    Set Plage = Range("B30:H30") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
     
    Set Plage = Range("B31:H31") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    Set Plage = Range("B32:H32") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    Set Plage = Range("B33:H33") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    Set Plage = Range("B34:H34") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    Set Plage = Range("B35:H35") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    Set Plage = Range("B36:H36") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    Set Plage = Range("B37:H37") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    '                Arrivé
    Set Plage = Range("O18:U18") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    Set Plage = Range("O19:U19") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    Set Plage = Range("O20:U20") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    Set Plage = Range("O21:U21") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    Set Plage = Range("O22:U22") 'a adapter
     
    For Each C In Plage
        If Not C = "" Then
            If Application.CountIf(Plage, C) > 1 Then
                C.Interior.ColorIndex = 45
            End If
        End If
    Next C
     
    End Sub
    la clé "end" doit être sur toutes les macros?

    merci pour vos réponse

  5. #5
    Expert éminent sénior

    Profil pro
    Conseil, Formation, Développement - Indépendant
    Inscrit en
    Février 2010
    Messages
    8 507
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Conseil, Formation, Développement - Indépendant

    Informations forums :
    Inscription : Février 2010
    Messages : 8 507
    Points : 16 432
    Points
    16 432
    Par défaut
    Bonjour
    Citation Envoyé par Menhir Voir le message
    Avant de saturer 4Go de mémoire physique avec Excel, il faut vraiment une application extrêmement lourde (du type plusieurs milliards de variables).

    Ca peut soit venir d'un problème dans ton code (sans plus d'info, difficile de t'aider à ce sujet).
    Ou bien d'une autre appli qui tourne en même temps et qui te sature la mémoire (à suive avec l'onglet Performance du gestionnaire de taches).
    Ou simplement d'une barrette mémoire cramée (ou quelque chose du genre).
    En 32 bits On ne dispose que de 3go, moins la partie utilisée par l'OS et les logiciels : seul Excel 64 bits gère au delà...

  6. #6
    Expert éminent sénior Avatar de Menhir
    Homme Profil pro
    Ingénieur
    Inscrit en
    Juin 2007
    Messages
    16 037
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Finistère (Bretagne)

    Informations professionnelles :
    Activité : Ingénieur
    Secteur : Industrie

    Informations forums :
    Inscription : Juin 2007
    Messages : 16 037
    Points : 32 866
    Points
    32 866
    Par défaut
    Même en supposant que l'OS et Excel prennent 1 Go, avec les 2 Go restant (en ajoutant bien sûr la swap disque qui en fait généralement autant), tu as le temps de voir venir. Surtout avec un simple fichier Excel.

    La seule fois où j'ai calé en mémoire un 32 bits, c'était avec de l'AutoCAD en 3D après 6h de manipulation. Il faut dire que AutoCAD gère très mal la mémoire et la remplie sans jamais la vider (ou quasiment).

    Tout ça pour dire que lorsqu'on sature la mémoire avec une macro, à moins que ce soit une appli du tonnerre de dieu, c'est qu'il y a un problème.
    Comme le disait Fox Mulder, "la vérité est ailleurs".

  7. #7
    Expert éminent sénior
    Avatar de Marc-L
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Avril 2013
    Messages
    9 468
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2013
    Messages : 9 468
    Points : 18 674
    Points
    18 674
    Par défaut


    Malgré la version 2003 ne gérant qu'un Giga, j'ai extrêmement beaucoup de mal à saturer la mémoire ‼

  8. #8
    Expert éminent sénior

    Profil pro
    Conseil, Formation, Développement - Indépendant
    Inscrit en
    Février 2010
    Messages
    8 507
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Conseil, Formation, Développement - Indépendant

    Informations forums :
    Inscription : Février 2010
    Messages : 8 507
    Points : 16 432
    Points
    16 432
    Par défaut
    Bonjour

    J'ai ouvert hier un fichier de 21 Mo en xlsb (48 en xlsx) transmis via un forum et malgré mes 8GO de mémoire (mais Office 32 bits) je ne pouvais rien en faire (pas de VBA dedans) juste une foultitude de colonnes sur 800 lignes avec des SOMME simples sur certaines colonnes et une trentaine de NB.SI.ENS dans un autre onglet. Message erreur mémoire saturée même pour insérer une ligne ou supprimer une colonne vide... Calculs ou non désactivés...

    Donc la pratique n'est pas toujours conforme à la théorie...

    Ceci dit, je suis 100% d'accord sur le fait que du code VBA Mal écrit peut fiche la panouille en mémoire...

  9. #9
    Expert éminent sénior Avatar de Menhir
    Homme Profil pro
    Ingénieur
    Inscrit en
    Juin 2007
    Messages
    16 037
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Finistère (Bretagne)

    Informations professionnelles :
    Activité : Ingénieur
    Secteur : Industrie

    Informations forums :
    Inscription : Juin 2007
    Messages : 16 037
    Points : 32 866
    Points
    32 866
    Par défaut
    J'ai déjà traité des fichiers de 16 000 lignes 42 colonnes (dont quelques dates et String) dans l'onglet principal avec une vingtaines d'onglets de traitement contenant CHACUN au moins une fonction FREQUENCE, plusieurs graphique et une foultitude d'autres fonctions de statistiques plus basiques.
    57 Mo à l'enregistrement en XLS.
    Le tout sur un Win XP 32 bit avec 2 Go de RAM et un Office 2000.
    Aucun problème de mémoire.
    Par contre, niveau temps de calcul, ça ramait un peu.

  10. #10
    Nouveau membre du Club
    Homme Profil pro
    Inscrit en
    Janvier 2013
    Messages
    42
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Secteur : Industrie

    Informations forums :
    Inscription : Janvier 2013
    Messages : 42
    Points : 34
    Points
    34
    Par défaut
    merci à vous tous
    j'ai trouvé ce qui posai le problème c'est un programme
    qui fonctionnai en arrière plant et j'ai augmenté la taille
    de la mémoire virtuelle et j'ai fait plusieurs teste et tout
    est rentré dans l'ordre

    merci encore et bon w end

    ps: dsl mais vous ne m'avez pas renseigné pour simplifier
    la macro que j'ai exposé plus haut!!

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [XL-2010] Problème ruban perso excel 2010
    Par Michel DEMANET dans le forum Conception
    Réponses: 6
    Dernier message: 03/06/2013, 18h54
  2. problème d'ouverture excel 2010 64b
    Par tarmo57 dans le forum Débuter
    Réponses: 4
    Dernier message: 14/10/2011, 18h42
  3. [XL-2010] Problème de compatibilité Excel 2010 lu sous 2007
    Par Sibuxian dans le forum Excel
    Réponses: 0
    Dernier message: 18/09/2011, 01h34
  4. [PPT-2007] Problème ouverture tableau Excel sur PPT
    Par mohyac dans le forum Powerpoint
    Réponses: 4
    Dernier message: 18/08/2011, 16h41
  5. [VxiR2] problème affichage tableau excel DESKI
    Par padwall dans le forum Deski
    Réponses: 3
    Dernier message: 27/01/2010, 11h29

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo