windows 2000?????

dakama

XLDnaute Nouveau
bonsoir messieurs et mesdames les excelliens....

j'ai une question, peut être idiote, je ne sais pas....
voilà j'ai crée un programme sous excel 2000 à la maison mais qui ne trouve d'application qu'à mon travail.... il y a deux semaines nous sommes passés sous windows 2000 et depuis mon programme ne fait que rencontrer des soucis.... il faut savoir que pourtant la version d'excel est restée strictement la même et celle de vba idem.... il m indique qu il y a un problème de compilation dans this workbook alors que je n'ai rien modifié et que chez moi, sous la même version d'excel (mais pas de windows) le programme ne signale pas d'erreurs.... y a t il quelque chose que j'ignore????? :)

merci d'avance

karine
 

dakama

XLDnaute Nouveau
bonjour,
au niveau de la sécurité des macros je n'ai pas vérifié... le code se bloque après l'installation de la sauvegarde auto....pourtant à la maison tous se passe bien, excel m affiche les msgbox et me verouille les feuilles....
une idée????

merci d'avance

karine

Sub workbook_open()
AddIns('enregistrement automatique').Installed = True
Dim sup
sup = MsgBox('Quel est le comble de la politesse? C 'est de s'asseoir sur son derrière et de lui demander pardon.', vbOKOnly, 'UN PEU D HUMOUR?...', 'vbdefaultbutton', vbInformation)
If sup = vbOK Then
End If
Object = MsgBox('çA VOUS A PLU? DITES LE A LA PAGE SUGGESTIONS...', vbOKOnly, 'karine', vbdefaultbutton, vbInformation)
If sup = vbOK Then
End If
Sheets('ouverture').Select
Application.ScreenUpdating = False
Application.Run ''LOCATION CAMIONS ET APPAREILS.xlS'!MsgBox_RealPBar'
Sheets('ACCUEIL').Select
With Worksheets('EV BENNE NE PAS TOUCHER')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('RESERVATIONS')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('IC2 NE PAS TOUCHER')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('EV NE PAS TOUCHER')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('EV2 NE PAS TOUCHER')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('RESERVATION')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('CONTRAT DE LOCATION')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('SUGGESTIONS')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('IC NE PAS TOUCHER')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('RESERV DECOLLEUSES')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('RESERV CARRELETTES')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('RESERV TAT')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('ACCUEIL')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('LOCA VEHICULE')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('RESERVATION SEM A')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('RESERVATION SEM C')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('RESERVATION SEM D')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('RESERVATION SEM E')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('RESERVATION SEM B')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('RESERVATION SEM F')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('ouverture')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
Dim nombre As Integer
nombre = ActiveWorkbook.Sheets.Count
Application.ScreenUpdating = False
For I = 1 To nombre
Worksheets(I).Unprotect password:='contrat'
Next I
nombre = ActiveWorkbook.Sheets.Count
Application.ScreenUpdating = False
For I = 1 To nombre
Worksheets(I).Protect , password:='contrat'
Next I
Application.ScreenUpdating = True
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
SauvegardeClasseur
End Sub
 

dakama

XLDnaute Nouveau
bonjour,
au niveau de la sécurité des macros je n'ai pas vérifié... le code se bloque après l'installation de la sauvegarde auto....pourtant à la maison tous se passe bien, excel m affiche les msgbox et me verouille les feuilles....
une idée????

merci d'avance

karine

Sub workbook_open()
AddIns('enregistrement automatique').Installed = True
Dim sup
sup = MsgBox('Quel est le comble de la politesse? C 'est de s'asseoir sur son derrière et de lui demander pardon.', vbOKOnly, 'UN PEU D HUMOUR?...', 'vbdefaultbutton', vbInformation)
If sup = vbOK Then
End If
Object = MsgBox('çA VOUS A PLU? DITES LE A LA PAGE SUGGESTIONS...', vbOKOnly, 'karine', vbdefaultbutton, vbInformation)
If sup = vbOK Then
End If
Sheets('ouverture').Select
Application.ScreenUpdating = False
Application.Run ''LOCATION CAMIONS ET APPAREILS.xlS'!MsgBox_RealPBar'
Sheets('ACCUEIL').Select
With Worksheets('EV BENNE NE PAS TOUCHER')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('RESERVATIONS')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('IC2 NE PAS TOUCHER')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('EV NE PAS TOUCHER')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('EV2 NE PAS TOUCHER')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('RESERVATION')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('CONTRAT DE LOCATION')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('SUGGESTIONS')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('IC NE PAS TOUCHER')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('RESERV DECOLLEUSES')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('RESERV CARRELETTES')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('RESERV TAT')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('ACCUEIL')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('LOCA VEHICULE')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('RESERVATION SEM A')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('RESERVATION SEM C')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('RESERVATION SEM D')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('RESERVATION SEM E')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('RESERVATION SEM B')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('RESERVATION SEM F')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
With Worksheets('ouverture')
.EnableSelection = xlUnlockedCells
.Protect contents:=True, UserInterfaceOnly:=True
End With
Dim nombre As Integer
nombre = ActiveWorkbook.Sheets.Count
Application.ScreenUpdating = False
For I = 1 To nombre
Worksheets(I).Unprotect password:='contrat'
Next I
nombre = ActiveWorkbook.Sheets.Count
Application.ScreenUpdating = False
For I = 1 To nombre
Worksheets(I).Protect , password:='contrat'
Next I
Application.ScreenUpdating = True
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
SauvegardeClasseur
End Sub
 

Zon

XLDnaute Impliqué
Salut,

Si c'est à la sauvegarde il faudrait le code de la procédure sauvegardeclasseur. avant plus d'info (éventuellement envoies moi ton fichier par courriel) , ne serait-ce pas une histoire de chemin d'accés ou de droit d'administrateur ....


A+++
 

_Thierry

XLDnaute Barbatruc
Repose en paix
BonjourDakama, Zon, le Forum

Je serai d'avis de mon copain Zon, sans plus d'info difficile de comprendre ton problème...

Une pierre à l'édifice, peut-être juste Faute de Frappe dans ton Post, mais bon...

Une Macro évènementielle dans le PrivateModule de ThisWorkBook s'écrit :

Private Sub Workbook_Open()

Et pas

Sub workbook_open()

Ensuite une question toute idiote mais sait-on jamais...,

As-tu bien vérifié que l'AddIn XLA 'enregistrement automatique' est bien en place sur la Machine Concernée et aussi bien référencée dans les Macros Complémentaires du Menu Outils ? ('AutoSave.xla', si mon souvenir est exacte, car elle a disparue depuis Office 2002)

Bonne Journée
[ol]@+Thierry[/ol]
 

dakama

XLDnaute Nouveau
bonjour zon, thierry,

je joint la procédure sauvegarde classeur.... mais c'est à l'ouverture de mon classeur que l'erreur se fait.... en fait juste après l'installation d'autosave....
il n'accepte plus de me charger les msgbox et de protéger/déprotéger les feuilles....
pour ce qui est d'autosave oui il est bien existant sur cette version d'excel et fonctionne...
ce qui me préoccupe surtout c est que ce programme fonctionnait à la perfection jusqu'à ce que mon boulot passe sous windows 2000....et qu'à la maison il tourne super!!!!(ni erreur, ni bug, malgré des tests assez poussés de ma part....)

merci de vous pencher sur mon 'cas' :)

karine

en fait c est ce code que j utilise à la place de sauvegarde classeur :
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Close savechanges:=True
End Sub
 

_Thierry

XLDnaute Barbatruc
Repose en paix
Re Bonjour Karine, Zon, le Forum

Je n'ai pas Win 2000 sous la main, mais en tout cas, je ne pense pas que ce code puisse tourner sous n'importe quelle version de Windows.

En effet depuis toujours, la Syntax pour une message box se construit de la manière suivante :

MsgBox(prompt[, buttons] [, title] [, helpfile, context])

Or toi tu écris

Object = MsgBox('PAGE SUGGESTIONS...', vbOKOnly, 'karine', vbdefaultbutton, vbInformation)

Ce qui Signifie en Syntax

MsgBox(prompt[, buttons] [, title] [, Buttons][, Buttons]

Là tu ne risques pas de passer...

Pour le reste, je n'ai pas une version 2000 donc pas de XLA AutoSave... Mais voilà ton code remanié sur la XLA Utilitaire d'Analyse sur une version américaine ce qui donne 'Analysis ToolPak'

Option Explicit

Private Sub Workbook_Open()
Dim Message1 As Byte
Dim Message2 As String
Dim i As Integer

AddIns('Analysis ToolPak').Installed =
True

Message1 = MsgBox('Quel est le comble de la politesse? C
'est de s'asseoir sur son derrière et de lui demander pardon.', vbOKCancel + vbQuestion, 'UN PEU D HUMOUR?...')


If Message1 = vbOK Then
    Message2 = MsgBox('çA VOUS A PLU? DITES LE A LA PAGE SUGGESTIONS...', vbOKOnly + vbInformation, 'karine')
Else
   
Exit Sub 'Si on répond Cancel, on termine l'exécution du code.
End If

'NB : Subordonné à ce que ce classeur existe et soit ouvert, idem pour la macro
Application.Run '
'LOCATION CAMIONS ET APPAREILS.xlS'!MsgBox_RealPBar'
Sheets('ouverture').Select


For i = 1 To ActiveWorkbook.Sheets.Count
   
With Worksheets(i)
    .EnableSelection = xlUnlockedCells
    .Protect Password:='contrat', UserInterfaceOnly:=True
   
End With
Next i


End Sub


Ici je boucle toutes les feuilles pour la Protection en UserInterface Only...

Si tu dois le faire que sur certaine feuilles alors voici une boucle :

Dim Feuille As Variant

For Each Feuille In Array('EV BENNE NE PAS TOUCHER', 'RESERVATIONS', 'IC2 NE PAS TOUCHER', _
                          'EV NE PAS TOUCHER', 'RESERVATION', 'CONTRAT DE LOCATION', _
                          'SUGGESTIONS', 'IC NE PAS TOUCHER')
'continuer avec les autres Feuilles
   
With Worksheets(Feuille)
        .EnableSelection = xlUnlockedCells
        .Protect Password:='contrat', UserInterfaceOnly:=True
   
End With
Next Feuille

Bon Appétit
[ol]@+Thierry[/ol]
 

dakama

XLDnaute Nouveau
bonsoir thierry, zon, le forum,

je te remercie thierry d'avoir remanié mon code ... je le testerai dès demain matin et te tiens au courant ...
ce que mes 'chefs' ne comprennent pas c'est que là ce n est plus mon code dans excel qui pose problème mais la compatibilité de celui ci avec windows 2000, problème nouveau pour moi et incompréhensible de leur point de vue (ils ne comprennent rien ou pas grand chose au langage 'excellien' )... espérons que je pourrais 'sauver' mon programme sur lequel je travaille depuis un an ....

dans tous les cas merci encore et je regarde ça demain !!!!! :unsure:
 

Discussions similaires

Réponses
8
Affichages
534

Statistiques des forums

Discussions
312 670
Messages
2 090 742
Membres
104 644
dernier inscrit
MOLOKO67