Private Sub Timer1_Timer()
Timer1.Interval = 20000 'controllo timer che avvia il primo scaricamento dati
cmdScarica_Click
Timer1.Enabled = False
End Sub
Private Sub cmdScarica_Click()
Set xlApp = CreateObject("Excel.Application")
Set xls = xlApp.Workbooks.Open("C:DocumentiPROGRAMMA DATI.xlsm") 'Percorso del file
Set foglio = xls.Worksheets("DATI PULITI") 'Nome del foglio di excel
strTxt = foglio.Cells(2, 1)
txtNome(0).Text = strTxt 'Textbox dove scrivere i dati
strTxt = foglio.Cells(2, 2)
txtPq(0).Text = strTxt
strTxt = foglio.Cells(3, 1)
txtNome(1).Text = strTxt
strTxt = foglio.Cells(3, 2)
txtPq(1).Text = strTxt
strTxt = foglio.Cells(4, 1)
txtNome(2).Text = strTxt
strTxt = foglio.Cells(4, 2)
txtPq(2).Text = strTxt
strTxt = foglio.Cells(5, 1)
txtNome(3).Text = strTxt
strTxt = foglio.Cells(5, 2)
txtPq(3).Text = strTxt
cmdConfronta_Click
End Sub
Private Sub cmdConfronta_Click()
If txtVTA2.Text > txtVTA.Text Then ' elaborazione dei dati
txtNuomax.Text = txtVTA2.Text
........
|