Grazie mille David per la risposta ma la soluzione è ad un livello abbastanza distante dalle
mie competenze. Io conosco un pò di programmazione orientata agli eventi e sono...
very incasinato. Siccome la cosa sembra che funzioni lo stesso e bene... ho cambiato la password, ho messo "close" e così l'ho temporanemente "risolta".
Il foglio condiene una dozzina di Form. e due moduli Qui è tutto regolarmente pagato.
Elementi certi:
Con Office 2007 il problema era assente e torna ad essere assente se sposto il foglio elettronico su office 2007 naturalmente.
Nel workbook ho queste istruzioni:
Option Explicit
Dim SalvamiilDroppo, SalvamilExtend, SalvaVisualBasic As Boolean
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If ActiveSheet.Name <> "Prices" Then
If ThisWorkbook.Sheets("Prices").Range("db6") = "yes" Or ThisWorkbook.Sheets("Prices").Range("dc6") = "yes" Then
MsgBox " I AM SORRY. You have to complete the set-up of prices. " & vbCr & _
vbCr & " ", vbExclamation, "Focchi advice."
ThisWorkbook.Sheets("Prices").Activate
Exit Sub
Else
If ThisWorkbook.Sheets("prices").Visible = True Then
TogliLeProtezioniallaCartella
ThisWorkbook.Sheets("setup").Visible = False
ThisWorkbook.Sheets("prices").Visible = False
MettiLeProtezioniallaCartella
End If
End If
End If
End Sub
Private Sub Workbook_Open()
Dim Ctrl As Office.CommandBarControl
Dim RispostaSeVuoleSalvare As String
PossibilitaDiCopiaIncollareDaFuori = False
If ThisWorkbook.CreateBackup = False And ThisWorkbook.Sheets("setup").Range("n52").Value = "yes" Then
RispostaSeVuoleSalvare = MsgBox("Remember, every time You save , " & vbCr & _
" You are NOT creating a backup copy xlk of this workbook !" & vbCr & "of the previous time you saved." & _
vbCr & vbCr & "UNDERSTOOD FOR EVER? ", vbYesNo)
If RispostaSeVuoleSalvare = vbYes Then
TogliLeProtezionialFoglioSetup
ThisWorkbook.Sheets("setup").Range("n52").Value = "no"
MettiLeProtezionialFoglioSetup
End If
End If
If ThisWorkbook.CreateBackup = True And ThisWorkbook.Sheets("setup").Range("n52").Value = "yes" Then
RispostaSeVuoleSalvare = MsgBox("Remember, every time You save , " & vbCr & _
" You are creating a backup copy xlk of this workbook !" & vbCr & "of the previous time you saved." & _
vbCr & vbCr & "UNDERSTOOD FOR EVER? ", vbYesNo)
If RispostaSeVuoleSalvare = vbYes Then
TogliLeProtezionialFoglioSetup
ThisWorkbook.Sheets("setup").Range("n52").Value = "no"
MettiLeProtezionialFoglioSetup
End If
End If
With Application
SalvamiilDroppo = .CellDragAndDrop
.CellDragAndDrop = False
SalvamilExtend = .CellDragAndDrop
.ExtendList = False
End With
'se ci sono dei problemi tasto dx sotto pulisce il melo
'Application.CommandBars("Cell").Enabled = False
'Application.OnKey "^x", ""
Application.OnKey "^x", ""
'Application.OnKey "^c", ""
'Application.OnKey "^v", ""
'stoppabottone macro
For Each Ctrl In Application.CommandBars.FindControls(ID:=186)
Ctrl.Enabled = False
Next Ctrl
'stoppabottone macro
For Each Ctrl In Application.CommandBars.FindControls(ID:=184)
Ctrl.Enabled = False
Next Ctrl
For Each Ctrl In Application.CommandBars.FindControls(ID:=21)
Ctrl.Enabled = False
Next Ctrl
VerificaStabilitàdelFoglio
' disabilitazione scheda macro va messo a false
SalvaVisualBasic = Application.ShowDevTools
Application.ShowDevTools = False
'suggerito in un newsgroup ma lo cancellerò
'Application.GenerateTableRefs = xlGenerateTableRefStruct
'MettiLeProtezioniallaCartella
Application.ScreenUpdating = False
Woconvert
Application.ScreenUpdating = True
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim Ctrl As Office.CommandBarControl
VerificaStabilitàdelFoglio
If FoglioInstabile = True Then Cancel = True
With Application
.CellDragAndDrop = True
.ExtendList = True
End With
Application.CommandBars("Cell").Enabled = True
Application.OnKey "^x"
Application.OnKey "^c"
Application.OnKey "^v"
For Each Ctrl In Application.CommandBars.FindControls(ID:=21)
Ctrl.Enabled = True
Next Ctrl
' disabilitazione scheda macro riprendo quello che c'era
Application.ShowDevTools = SalvaVisualBasic
'suggerito in un newsgroup ma lo cancellerò
'Application.GenerateTableRefs = xlGenerateTableRefStruct
End Sub
Private Sub Workbook_Activate()
Dim Ctrl As Office.CommandBarControl
If PossibilitaDiCopiaIncollareDaFuori = False Then
With Application
.CellDragAndDrop = False
.ExtendList = False
End With
End If
'Application.GenerateTableRefs = xlGenerateTableRefStruct
'elimina taglia
Application.OnKey "^x", ""
'elimina taglia
For Each Ctrl In Application.CommandBars.FindControls(ID:=21)
Ctrl.Enabled = False
Next Ctrl
If ThisWorkbook.Sheets("setup").Range("n64").Value = "yes" Then FormBloccate = True
If ThisWorkbook.Sheets("setup").Range("n64").Value = "NO" Then FormBloccate = False
End Sub
Private Sub TogliLeProtezionialFoglioSetup()
ThisWorkbook.Sheets("setup").Unprotect Password:=PasswordFogliCartelle
End Sub
Private Sub TogliLeProtezioniallaCartella()
ThisWorkbook.Unprotect (PasswordFogliCartelle)
End Sub
Private Sub Workbook_Deactivate()
If PossibilitaDiCopiaIncollareDaFuori = False Then
With Application
.CellDragAndDrop = True
.ExtendList = True
End With
End If
End Sub
Private Sub Woconvert()
Dim RicordaFoglio, stesto As String
Dim x As Long
RicordaFoglio = ThisWorkbook.ActiveSheet.Name
stesto = Application.UserName & vbTab & Now
ThisWorkbook.Sheets("Setup").Unprotect (PasswordFogliCartelle)
ThisWorkbook.Sheets("Setup").Activate
ThisWorkbook.ActiveSheet.Cells(2, 21).Activate
For x = 2 To 32000
If ThisWorkbook.Sheets("Setup").Range("u" & x) = "" Then GoTo OttenutaRiagadiPosizionamentoFinale
' ThisWorkbook.Sheets("Setup").Cells(x, 21).Activate
Next x
OttenutaRiagadiPosizionamentoFinale:
ThisWorkbook.Sheets("Setup").Cells(x, 21) = stesto
If ThisWorkbook.Sheets("prices").Visible = False And RicordaFoglio = "Prices" Then
TogliLeProtezioniallaCartella
ThisWorkbook.Sheets("prices").Visible = True
MettiLeProtezioniallaCartella
End If
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:=PasswordFogliCartelle
If RicordaFoglio = "Prices" Then ThisWorkbook.Sheets("Prices").Unprotect (PasswordFogliCartelle)
ThisWorkbook.Sheets(RicordaFoglio).Select
End Sub
Se trovassi la strada comunque sarebbe meglio.
Ciao Grazie in ogni caso per la collaborazione
Indriano.