Anthony47 ha scritto:Direi che abbiamo dimostrato che Excel vale il costo della sua licenza.
Alla prossima.
Beh ... diciamo che forse non è tutt'oro quanto pesa !!!
Il programma funziona perfettamente, ma quando lancio l'userform6, e solo allora, che contiene questo codice:
- Codice: Seleziona tutto
Private Sub CommandButton1_Click()
If CheckBox1.Value = True Then
Workbooks("tabulato.xls").Close
Workbooks("database.xls").Close
Workbooks("ad.xls").Close
Else
If CheckBox2.Value = True Then
If Len(Trim(fil)) <> 0 Then
diptab = Workbooks("Tabulato.xls").Worksheets("elaborazione").Cells(1, 2).Value
If Val(fil) <> Val(adtab) Then
If MsgBox("Attenzione è presente il tabulato della Ditta " + Str(adtab) + " ma è stata selezionata la Ditta " + Str(fil) + " Verrà salvato il tabulato della Ditta " + Str(adtab), vbExclamation + vbYesNo, "Incongruenza") = vbYes Then
Application.DisplayAlerts = False
Workbooks("tabulato.xls").SaveAs Application.ActiveWorkbook.Path & "\" & Right("000" + Trim(Str(adtab)), 3) + "_tab_ditta.xls", xlWorkbookNormal
Application.DisplayAlerts = True
Else
Exit Sub
End If
Else
Application.DisplayAlerts = False
Workbooks("tabulato.xls").SaveAs Application.ActiveWorkbook.Path & "\" & Right("000" + Trim(Str(adtab)), 3) + "_tab_ditta.xls", xlWorkbookNormal
Application.DisplayAlerts = True
End If
Else
adtab = Workbooks("Tabulato.xls").Worksheets("elaborazione").Cells(1, 2).Value
If Len(Str(adtab)) <> 0 Then
If MsgBox("Attenzione. Non è stata seleziona alcuna Ditta ma è presente il tabulato della Ditta " + Str(adtab) + " che verrà salvato. Continui ?", vbExclamation + vbYesNo, "Incongruenza") = vbYes Then
Application.DisplayAlerts = False
Workbooks("tabulato.xls").SaveAs Application.ActiveWorkbook.Path & "\" & Right("000" + Trim(Str(adtab)), 3) + "_tab_ditta.xls", xlWorkbookNormal
Application.DisplayAlerts = True
Else
Exit Sub
End If
End If
End If
End If
End If
End Sub
compare una finestra in cui c'e' scritto
MICROSOFT EXCEL HA SMESSO DI FUNZIONARE
(ricerca soluzione in corso)
e subito dopo un'altra
MICROSOFT EXCEL HA SMESSO DI FUNZIONARE
Windows: si è verificato un problema che impedisce il funzionamento corretto del programma. Se è disponibile una soluzione, verrà chiuso il programma e inviata una notifica automatica. [Chiudi programmi]
Ed excel si chiude.
Mah ....