insufficient disk space when running macro

stephfr

New Member
Joined
Aug 17, 2011
Messages
39
I have a strange problem....

When I run a macro on my mac or on my work PC, it works perfectly well. However, when the guy who I wrote the macro for, runs it on his PC, excel closes with an error (in french so the translation may not be perfect) saying insufficient battery. I have no idea why..

This is my macro

Private Sub Worksheet_Change(ByVal Target As Range)

Dim KeyCellCaps As Range
Dim KeyCellNom As Range
Dim KeyCellMedia As Range
Dim KeyCellPrenom As Range
Dim KeyCellVille As Range
Dim KeyCellPostale As Range
Dim KeyCellTel As Range
Dim KeyCellFax As Range

Set KeyCellCaps = Range("A:A")
Set KeyCellNom = Range("A:A")
Set KeyCellPrenom = Range("B:B")
Set KeyCellMedia = Range("C:C")
Set KeyCellPostale = Range("E:E")
Set KeyCellVille = Range("F:F")
Set KeyCellTel = Range("G:G")
Set KeyCellFax = Range("H:H")

Column = "Q"


' Mettre le nom en majuscule et rajouter la date d'ajout

If Not Application.Intersect(KeyCellCaps, Range(Target.Address)) _
Is Nothing Then
If Target.Count > 1 Then Exit Sub

Target.Value = UCase(Target.Text)
Intcolumn = Target.Column
introw = Target.Row
Cells(introw, Column) = Now()

End If

' si le prénom est rajouté ou modifié, rajouter la date d'ajout

If Not Application.Intersect(KeyCellPrenom, Range(Target.Address)) _
Is Nothing Then


Prenom = Target.Text
P = Left(Prenom, 1)
P = UCase(P)
Renom = Mid(Prenom, 2)
Prenom = P & Renom
Target.Value = Prenom

Intcolumn = Target.Column
introw = Target.Row
Cells(introw, Column) = Now()
End If

' si le champ Médias est rajouté ou modifié, rajouter la date d'ajout

If Not Application.Intersect(KeyCellMedia, Range(Target.Address)) _
Is Nothing Then


Intcolumn = Target.Column
introw = Target.Row
Cells(introw, Column) = Now()
End If

'Convertir le code postale
If Not Application.Intersect(KeyCellPostale, Range(Target.Address)) _
Is Nothing Then

v = [{"&",1;"é",2;"""",3;"'",4;"(",5;"§",6;"è",7;"!",8;"ç",9;"à",0}]

s = Target.Value
For j = 1 To 10
s = Replace(s, v(j, 1), v(j, 2))
Next j

Application.EnableEvents = False
Range(Target.Address) = s
Application.EnableEvents = True
End If


'Convertir le numéro de téléphone

If Not Application.Intersect(KeyCellTel, Range(Target.Address)) _
Is Nothing Then

v = [{"&",1;"é",2;"""",3;"'",4;"(",5;"§",6;"è",7;"!",8;"ç",9;"à",0}]
s = Target.Value
For j = 1 To 10
s = Replace(s, v(j, 1), v(j, 2))
Next j

Application.EnableEvents = False
Range(Target.Address) = s
Application.EnableEvents = True
End If

'Convertir le numéro de fax
If Not Application.Intersect(KeyCellFax, Range(Target.Address)) _
Is Nothing Then

v = [{"&",1;"é",2;"""",3;"'",4;"(",5;"§",6;"è",7;"!",8;"ç",9;"à",0}]
s = Target.Value
For j = 1 To 10
s = Replace(s, v(j, 1), v(j, 2))
Next j

Application.EnableEvents = False
Range(Target.Address) = s
Application.EnableEvents = True
End If

' Mettre le nom de la ville en majuscules

If Not Application.Intersect(KeyCellVille, Range(Target.Address)) _
Is Nothing Then
Target.Value = UCase(Target.Text)
End If
End Sub

Anyone have any ideas? (does it work for you?)
Basically what it does is this:
Rows A & F - Convert the text to UpperCase
Row B - Convert the text to ProperCase
Rows E,G & H - Converts numbers entered on a french keyboard without the shift key having being pressed into numbers.

Thanks
Steph

PS, the error says:
Erreur d'exécution
Espace Pile insuffisant
(pile is actually battery but I'm guessing it means insufficient disk space)
 
Hi Mike

Thanks. The addtion of the date is added to another column if the given cell is modified.

I added the Application.EnableEvents and have resent the file. I still don't understand why it works perfectly on my mac (and my pc at work) but not on his mac. Very strange.

I've sent to another friend too to see if he has a problem or not running it.

For the moment, I gave my friend a different macro that automatically corrects all of the cells in the columns with the good format when he closes excel and this works on his mac!!.

Thanks again for your help. You guys are amazing :)

Steph
 
Upvote 0

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hi Mike

You're great!!!!! I added the Application.EnableEvents and he ran it and it works perfectly :)

Thanks everyone for helping - I really appreciate it :)

Have a great week end
Steph
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,299
Members
452,904
Latest member
CodeMasterX

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top