Private Sub Cmdsalva_Click()
Dim oldname As String
Dim newname As String
Dim XLS As New Excel.Application
With XLS
.Workbooks.Open App.Path & "\riparazione.xls"
'oldname = App.Path & "\riparazione.xls"
.Worksheets(1).Select
.Range("C4").Select
.ActiveCell.Value = txtcliente.Text
.Range("C6").Select
.ActiveCell.Value = txtindirizzo.Text
.Range("B8").Select
.ActiveCell.Value = txtcitta.Text
.Range("F8").Select
.ActiveCell.Value = txttelefono.Text 'Label5.Caption
.Range("B10").Select
.ActiveCell.Value = txtvettura.Text
.Range("F10").Select
.ActiveCell.Value = txtkm.Text
.Range("B12").Select
.ActiveCell.Value = txttarga.Text
.Range("F12").Select
.ActiveCell.Value = txtmotore.Text
.Range("A16").Select
.ActiveCell.Value = txtq1.Text
.Range("B16").Select
.ActiveCell.Value = txtd1.Text
.Range("I16").Select
.ActiveCell.Value = txteuro1.Text
.Range("A17").Select
.ActiveCell.Value = txtq2.Text
.Range("B17").Select
.ActiveCell.Value = txtd2.Text
.Range("I17").Select
.ActiveCell.Value = txteuro2.Text
.Range("A18").Select
.ActiveCell.Value = txtq3.Text
.Range("B18").Select
.ActiveCell.Value = txtd3.Text
.Range("I18").Select
.ActiveCell.Value = txteuro3.Text
.Range("A19").Select
.ActiveCell.Value = txtq4.Text
.Range("B19").Select
.ActiveCell.Value = txtd4.Text
.Range("I19").Select
.ActiveCell.Value = txteuro4.Text
.Range("A20").Select
.ActiveCell.Value = txtq5.Text
.Range("B20").Select
.ActiveCell.Value = txtd5.Text
.Range("I20").Select
.ActiveCell.Value = txteuro5.Text
.Range("A21").Select
.ActiveCell.Value = txtq6.Text
.Range("B21").Select
.ActiveCell.Value = txtd6.Text
.Range("I21").Select
.ActiveCell.Value = txteuro6.Text
.Range("A22").Select
.ActiveCell.Value = txtq7.Text
.Range("B22").Select
.ActiveCell.Value = txtd7.Text
.Range("I22").Select
.ActiveCell.Value = txteuro7.Text
.Range("A23").Select
.ActiveCell.Value = txtq8.Text
.Range("B23").Select
.ActiveCell.Value = txtd8.Text
.Range("I23").Select
.ActiveCell.Value = txteuro8.Text
.Range("A24").Select
.ActiveCell.Value = txtq9.Text
.Range("B24").Select
.ActiveCell.Value = txtd9.Text
.Range("I24").Select
.ActiveCell.Value = txteuro9.Text
.Range("A25").Select
.ActiveCell.Value = txtq10.Text
.Range("B25").Select
.ActiveCell.Value = txtd10.Text
.Range("I25").Select
.ActiveCell.Value = txteuro10.Text
.Range("A26").Select
.ActiveCell.Value = txtq11.Text
.Range("B26").Select
.ActiveCell.Value = txtd11.Text
.Range("I26").Select
.ActiveCell.Value = txteuro11.Text
.Range("A27").Select
.ActiveCell.Value = txtq12.Text
.Range("B27").Select
.ActiveCell.Value = txtd12.Text
.Range("I27").Select
.ActiveCell.Value = txteuro12.Text
.Range("I36").Select
.ActiveCell.Value = txtimponibile.Text
.Range("I37").Select
.ActiveCell.Value = txtiva.Text
.Range("I38").Select
.ActiveCell.Value = txttotale.Text
.Visible = False 'true
'newname = App.Path & "\SCHEDE DI RIPARAZIONE\" & txtcliente.Text & ".xls"
.SaveWorkspace App.Path & "\SCHEDE DI RIPARAZIONE\" & txtcliente.Text & ".xls"
MsgBox "FILE CLIENTE: " & txtcliente & " SALVATO CON SUCCESSO ", , "GARAGE MARCO"
End With
'XLS.Workbooks(1).Close true
' mandalo in stampa
End Sub