Re : probleme macro qui fonctionne avec excel 2000 et pas 97
Re Boudu
Encore un petit pb de supprimer ( j'espère... )
Private Sub CommandButton1_Click()
Dim nomfic As String
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Application.ScreenUpdating = False
Cells.Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
nomfic = ActiveWorkbook.Name
While nomfic02 = ""
nomfic02 = Application.GetSaveAsFilename
Wend
nomfic01 = nomfic02 & "xls"
Msg = "Souhaitez-vous enregistrer ce fichier?"
Style = vbYesNo
Title = "Démonstration de MsgBox "
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then
MyString = "Oui"
ActiveSheet.Protect Password:="jojo"
ActiveWorkbook.SaveAs FileName:=nomfic01, FileFormat _
:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:= _
False, CreateBackup:=False
MsgBox "Le fichier est enregistré sous le nom : " & nomfic02
End If
ActiveWorkbook.Close
Range("A1").Select
ActiveSheet.Protect Password:="jojo"
End Sub
A+