Erreur 13 incompatibilité de type

RONIBO

XLDnaute Impliqué
Bonjour,

Je viens vers vous suite à un problème que je n'arrive pas à résoudre,

J'utilise ce que pour vérifier l'orthographe et la grammaire

Code:
'Vérifier l'orthographe
Function MessageCelluleVideVérificationOrthographe(LeMessage As String, TitreMessage As String)
MsgBox LeMessage, vbInformation, TitreMessage
End Function
Sub BoutonVérificationOrthographe()
ActiveSheet.Unprotect
If [VérificationOrthographe] = 0 Then Call MessageCelluleVideVérificationOrthographe("Cellule vide", "Cellule incomplète"): Exit Sub
ActiveWindow.SmallScroll Down:=12
Range("VérificationOrthographe").Select
ActiveWindow.SmallScroll Down:=-33
Selection.CheckSpelling SpellLang:=1036
Range("F1:G1").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowFormattingRows:=True
ActiveSheet.EnableSelection = xlUnlockedCells
End Sub

Sur ce code j'ai intégré ceci :

Code:
Function MessageCelluleVideVérificationOrthographe(LeMessage As String, TitreMessage As String)
MsgBox LeMessage, vbInformation, TitreMessage
End Function

Mon but est d'afficher un message box si les cellules sont vides.

J'ai défini la plage concerné grâce au gestionnaire de nom "VérificationOrthographe"

Et au moment de l'exécution j'ai un message d'erreur incompatibilité de type (erreur 13)

Vous avez une idée?
 

Pièces jointes

  • Exemple.xlsm
    17.2 KB · Affichages: 22
  • Exemple.xlsm
    17.2 KB · Affichages: 31
  • Exemple.xlsm
    17.2 KB · Affichages: 28

kjin

XLDnaute Barbatruc
Re : Erreur 13 incompatibilité de type

Bonjour,
Code:
Sub BoutonVérificationOrthographe()
If Application.CountA([VérificationOrthographe]) = 0 Then Call MessageCelluleVideVérificationOrthographe("Cellules vide", "Cellule incomplète"): Exit Sub
ActiveSheet.Unprotect
[VérificationOrthographe].CheckSpelling SpellLang:=1036
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowFormattingRows:=True
End Sub
A+
kjin
 

Discussions similaires

Statistiques des forums

Discussions
312 471
Messages
2 088 707
Membres
103 927
dernier inscrit
Mkeal